home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / WINDOWS / WB_33C.ARJ / WINBATCH.MA$ < prev    next >
Text File  |  1992-06-14  |  303KB  |  11,135 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.                                       TUTORIAL
  8.  
  9.  
  10.      Well, we admit it, we're still working on the documentation.
  11.      There are over 200 pages of it in this file.  We're working on
  12.      it every day.  A number of our products run our common WIL
  13.      language, so the manual has been written to cover all the products.
  14.  
  15.      Thats why you will see references to other products as you go
  16.      through the manual.
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.                                      BATCH FILES
  25.  
  26.  
  27.  
  28.  
  29.        WIL Basics
  30.  
  31.  
  32.  
  33.        What is a Batch File?
  34.        A batch file, whether a DOS batch file or a WIL file, is simply a list
  35.        of commands for the computer to process.  Any task which will be run
  36.        more than once, or which requires entering many commands or even a
  37.        single complex command, is a candidate for a batch file.  For example,
  38.        suppose you regularly enter the following commands to start Windows:
  39.  
  40.        First:
  41.  
  42.         cd\windows
  43.  
  44.        then:
  45.  
  46.         win
  47.  
  48.        and then:
  49.  
  50.         cd\
  51.  
  52.        Here, you are changing to the Windows directory, running Windows, and
  53.        then returning to the root directory.  Instead of having to type these
  54.        three commands every time you run Windows, you can create a DOS batch
  55.        file, called WI.BAT, which contains those exact same commands:
  56.  
  57.         cd\windows
  58.         win
  59.         cd\
  60.  
  61.        Now, to start Windows, you merely need to type the single command WI,
  62.        which runs the WI.BAT batch file, which executes your three commands.
  63.  
  64.        WIL files work basically the same way.
  65.  
  66.  
  67.  
  68.  
  69.        Our First WIL File
  70.        Our first WIL file will simply run our favorite Windows application:
  71.        Solitaire.  First, start up Notepad, or any other editor which is
  72.        capable of saving text in pure ASCII format (may we suggest WinEdit,
  73.        from Wilson WindowWare).  Enter the following line of text:
  74.  
  75.         Run("sol.exe", "")
  76.  
  77.        Save the file with the name SOLITARE.WBT.  Now, run SOLITARE.WBT by
  78.        starting or switching to the File Manager (or MS-DOS Executive), and
  79.        either moving the cursor to the file name and pressing Enter, or
  80.  
  81.  
  82.  
  83.  
  84.  
  85.        double-clicking on the file name with your mouse.  Presto!  It's
  86.        Solitaire.
  87.  
  88.        Okay, that wasn't really so impressive.  But it did serve to
  89.        illustrate several important WIL points.  They are:
  90.  
  91.        1.   WIL files must be edited and saved in ASCII format.
  92.  
  93.        2.   WIL files should be given a WBT extension.  When WIL is first
  94.          installed, it creates an entry in your WIN.INI file which causes
  95.          files with a WBT extension to be associated with WIL.  As long as
  96.          WIL.EXE is located in your DOS path, you can place WBT files in any
  97.          directory and run them by simply selecting them, as we did above.
  98.  
  99.        3.   After you have created a WBT file, you run it by moving your
  100.          cursor to it and pressing Enter, or double-clicking on it with your
  101.          mouse (you can also add a WBT file to a program group and run it
  102.          using the Program Manager; see your Windows manual for further
  103.          information).  Whatever method you use, we'll use the term Run to
  104.          refer to selecting and running the file.
  105.  
  106.  
  107.  
  108.  
  109.        Functions and Parameters
  110.        Now, let's look more closely at the line we entered:
  111.  
  112.         Run("sol.exe", "")
  113.  
  114.        The first part, Run, is a WIL function.  As you might have guessed,
  115.        its purpose is to run a Windows program.  There are over a hundred
  116.        different functions and commands in WIL, and each has a certain syntax
  117.        which must be used.  The correct syntax for all WIL functions may be
  118.        found in the WIL Function Reference (pg. 55).  The entry for Run
  119.        starts off as follows:
  120.  
  121.  
  122.        Syntax:
  123.         Run (program-name, parameters)
  124.  
  125.        Parameters:
  126.         "program-name" =the name of the desired .EXE, .COM, .PIF, .BAT file,
  127.                      or a data file.
  128.         "parameters" =     optional parameters as required by the
  129.                      application.
  130.  
  131.  
  132.        Like all WIL functions, Run is followed by a number of parameters,
  133.        enclosed in parentheses.  Parameters are simply additional information
  134.        which are provided when a particular function is used; they may be
  135.        either required or optional.  Optional parameters are indicated by
  136.        being enclosed in square brackets.  In this case, Run has two required
  137.        parameters: the name of the program to run, and the parameters to be
  138.        passed to the program.
  139.  
  140.        WIL functions use several types of parameters.  Multiple parameters
  141.        are separated by commas.  In the example
  142.  
  143.  
  144.  
  145.  
  146.  
  147.         Run("sol.exe", "")
  148.  
  149.        "sol.exe" and "" are both string constants.  String constants can be
  150.        identified by the quote marks which delimit (surround) them.  You may
  151.        use either double ("), single forward (') or single back (`) quote
  152.        marks as string delimiters; the examples in this manual will use
  153.        double quotes.
  154.  
  155.        You may have noticed how we said earlier that the two parameters for
  156.        the Run function are required, and yet the entry for Run in the WIL
  157.        Function Reference describes the second parameter -- "parameters" --
  158.        as being optional.  Which is correct?  Well, from a language
  159.        standpoint, the second parameter is required.  That is, if you omit
  160.        it, you will get a syntax error, and your batch file will not run
  161.        properly.  However, the program that you are running may not need any
  162.        parameters.  Solitaire, for example, does not take any parameters.
  163.        The way we handle this in our batch file is to specify a null string -
  164.        - two quote marks with nothing in between -- as the second parameter,
  165.        as we have done in our example above.
  166.  
  167.        To illustrate this further, let's create a WIL file called EDIT.WBT,
  168.        containing the following line:
  169.  
  170.         Run("notepad.exe", "")
  171.  
  172.        This is just like our previous file, with only the name of the program
  173.        having been changed.  Save the file, and run it.  You should now be in
  174.        Notepad.  Now edit the EDIT.WBT file as follows:
  175.  
  176.         Run("notepad.exe", "solitare.wbt")
  177.  
  178.        Save the file, exit Notepad, and run EDIT.WBT again.  You should now
  179.        be in Notepad, with SOLITARE.WBT loaded.  As we've just demonstrated,
  180.        Notepad is an example of a program which can be run with or without a
  181.        file name parameter passed to it by WIL.
  182.  
  183.        Before you leave Notepad, modify EDIT.WBT as follows:
  184.  
  185.         ; This is an example of the Run function in WIL
  186.         Run("notepad.exe", "solitare.wbt")
  187.  
  188.        The semicolon at the beginning of the first line signifies a comment,
  189.        and causes that line to be ignored.  You can place comment lines,
  190.        and/or blank lines anywhere in your WIL files.  In addition, you can
  191.        place a comment on the same line as a function by preceding the
  192.        comment with a semicolon.  For example:
  193.  
  194.         Run("sol.exe", "")   ; this is a very useful function
  195.  
  196.        Everything to the right of a semicolon is ignored.  However, if a
  197.        semicolon appears in a string delimited by quotes, it is treated as
  198.        part of the string.
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.        Displaying Text
  208.        Now, let's modify our SOLITARE.WBT file as follows.  You might as well
  209.        use the EDIT.WBT batch file you created earlier to start up Notepad:
  210.  
  211.         ; solitare.wbt
  212.         Display(5, "Good Luck!", "Remember ... it's only a game.")
  213.         Run("sol.exe", "")
  214.  
  215.        And run it.  Notice the message box which pops up on the screen with
  216.        words of encouragement:
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.        That's done by the Display function in the second line above.  Here's
  227.        the reference for Display:
  228.  
  229.  
  230.        Syntax:
  231.         Display (seconds, title, text)
  232.  
  233.        Parameters:
  234.         seconds =    integer seconds to display the message (1-15).
  235.         "title" =    Title of the window to be displayed.
  236.         "text" =     Text of the window to be displayed.
  237.  
  238.  
  239.        Note that the Display function has three parameters.  The first
  240.        parameter -- in our example, 5 -- is the number of seconds which the
  241.        display box will remain on the screen (you can make the box disappear
  242.        before then by pressing any key or mouse button).  This is a numeric
  243.        constant, and -- unlike string constants -- it does not need to be
  244.        enclosed in quotes (although it can be, if you wish, as WIL will
  245.        automatically try to convert string variables to numeric variables
  246.        when necessary, and vice versa).  The second parameter is the title of
  247.        the message box, and the third parameter is the actual text displayed
  248.        in the box.  Now, exit Solitaire (if you haven't already done so), and
  249.        edit SOLITARE.WBT by placing a semicolon at the beginning of the line
  250.        with the Run function.  This is a handy way to disable, or "comment
  251.        out," lines in your WIL files when you want to modify and test only
  252.        certain segments.  Your SOLITARE.WBT file should look like this:
  253.  
  254.         ; solitare.wbt
  255.         Display(5, "Good Luck!", "Remember ... it's only a game.")
  256.         ; Run("sol.exe", "")
  257.  
  258.        Now, experiment with modifying the parameters in the Display function.
  259.        Try adjusting the value of the first parameter.  If you look up
  260.        Display in the WIL reference section, you will see that the acceptable
  261.  
  262.  
  263.  
  264.  
  265.  
  266.        values for this parameter are 1-15.  If you use a value outside this
  267.        range, WIL will adjust it to "make it fit"; that is, it will treat
  268.        numbers less than 1 as if they were 1, and numbers greater than 15 as
  269.        15.  Experiment.  Also, try using a non-integer value, such as 2.5,
  270.        and see what happens.  Play around with the text in the two string
  271.        parameters; try making one, or both, null strings ("").
  272.  
  273.  
  274.  
  275.  
  276.        Getting Input
  277.        Now, let's look at ways of getting input from a user and making
  278.        decisions based on that input.  The most basic form of input is a
  279.        simple Yes/No response, and, indeed, there is a WIL function called
  280.        AskYesNo:
  281.  
  282.  
  283.        Syntax:
  284.         AskYesNo (title, question)
  285.  
  286.        Parameters
  287.         "title" =    title of the question box.
  288.         "question" = question to be put to the user.
  289.  
  290.        Returns:
  291.         (integer)    @YES or @NO, depending on the button pressed.
  292.  
  293.  
  294.        You should be familiar with the standard syntax format by now; it
  295.        shows us that AskYesNo has two required parameters.  The Parameters
  296.        section tells us that these parameters both take strings (indicated by
  297.        the quote marks), and tells us what each of the parameters means.
  298.  
  299.        You will notice that there is also a new section here, titled Returns.
  300.        This section shows you the possible values that may be returned by
  301.        this function.  All functions return values.  We weren't concerned
  302.        with the values returned by the Run and Display functions.  But with
  303.        AskYesNo, the returned value is very important, because we will need
  304.        that information to decide how to proceed.  We see that AskYesNo
  305.        returns an integer value.  An integer is a whole (non-fractional)
  306.        number, such as 0, 1, or 2 (the number 1.5 is not an integer).  We
  307.        also see that the integer value returned by AskYesNo is either @YES or
  308.        @NO.  @YES and @NO are predefined constants in WIL.  All predefined
  309.        constants begin with an @ symbol, and we will distinguish them further
  310.        by typing them in all caps.  You will find a list of all predefined
  311.        constants in Appendix A (pg. 185).  Even though the words Yes and No
  312.        are strings, it is important to remember that the predefined constants
  313.        @YES and @NO are not string variables (actually, @YES is equal to 1,
  314.        and @NO is equal to 0.  Don't worry if this is confusing; you don't
  315.        need to remember it).
  316.  
  317.        Now, let's modify our SOLITARE.WBT file as follows:
  318.  
  319.         AskYesNo("Really?", "Play Solitaire now?")
  320.         Run("sol.exe", "")
  321.  
  322.  
  323.  
  324.  
  325.  
  326.        and run it.  You should have gotten a nice dialog box which asked if
  327.        you wanted to play Solitaire:
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.        but no matter what you answered, it started Solitaire anyway.  This is
  342.        not very useful.  We need a way to use the Yes/No response to
  343.        determine further processing.  First, we need to explore the concept
  344.        and use of variables.
  345.  
  346.  
  347.  
  348.  
  349.        Using Variables
  350.        A variable is simply a placeholder for a value.  The value that the
  351.        variable stands for can be either a text string (string variable) or a
  352.        number (numeric variable).  You may remember from Algebra 101 that if
  353.        X=3, then X+X=6.  X is simply a numeric variable, which stands here
  354.        for the number 3.  If we change the value of X to 4 (X=4), then the
  355.        expression X+X is now equal to 8.
  356.  
  357.        Okay.  We know that the AskYesNo function returns a value of either
  358.        @YES or @NO.  What we need to do is create a variable to store the
  359.        value that AskYesNo returns, so that we can use it later on in our
  360.        batch file.  First, we need to give this variable a name.  In WIL,
  361.        variable names must begin with a letter, may contain any combination
  362.        of letters or numbers, and may be from 1 to 30 characters long.  So,
  363.        let's use a variable called response (we will distinguish variable
  364.        names in this text by typing them in all lowercase letters; we will
  365.        type function and command names starting with a capital letter.
  366.        However, in WIL, the case is not significant, so you can use all
  367.        lowercase, or all uppercase, or whatever combination you prefer).  We
  368.        assign the value returned by AskYesNo to the variable response, as
  369.        follows:
  370.  
  371.         response = AskYesNo("Really?", "Play Solitaire now?")
  372.  
  373.        Notice the syntax.  The way that WIL processes this line is to first
  374.        evaluate the result of the AskYesNo function.  The function returns a
  375.        value of either @YES or @NO.  Then, WIL assigns this returned value to
  376.        response.  Therefore, response is now equal to either @YES or @NO,
  377.        depending on what the user enters.
  378.  
  379.        Now, we need a way to make a decision based upon this variable.
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.        Making Decisions
  389.        WIL provides a way to conditionally execute a statement, and that is
  390.        by using the If ... Then command.  Actually, there are two separate
  391.        parts to this construct: If and Then.  The format is:
  392.  
  393.           If condition Then statement
  394.  
  395.        (We refer to If ... Then as a command, rather than a function, because
  396.        functions are followed by parameters in parentheses, while commands
  397.        are not.  Commands are used for system control.)
  398.  
  399.        The use of If ... Then can easily be illustrated by going back to our
  400.        SOLITARE.WBT file, and making these modifications:
  401.  
  402.         response = AskYesNo("Really?", "Play Solitaire now?")
  403.         If response == @YES Then Run("sol.exe", "")
  404.  
  405.        In this example, we are using If ... Then to test whether the value of
  406.        the variable response is @YES.  If it is @YES, we start Solitaire.  If
  407.        it isn't @YES, we don't.  The rule is: if the condition following the
  408.        If keyword is true, then the statement following the Then keyword is
  409.        performed.  If the condition following the If keyword is false, then
  410.        anything following the Then keyword is ignored.
  411.  
  412.        There is something extremely important that you should note about the
  413.        syntax of the If ... Then command: the double equal signs (==).  In
  414.        WIL, a single equal sign (=) is an assignment operator -- it assigns
  415.        the value on the right of the equal sign to the variable on the left
  416.        of the equal sign.  As in:
  417.  
  418.         response = AskYesNo("Really?", "Play Solitaire now?")
  419.  
  420.        This is saying, in English: "Assign the value returned by the AskYesNo
  421.        function to the variable named response."  But in the statement:
  422.  
  423.         If response == @YES Then Run("sol.exe", "")
  424.  
  425.        we do not want to assign a new value to response, we merely want to
  426.        test whether it is equal to @YES.  Therefore, we use the double equal
  427.        signs (==), which is the equality operator in WIL.  The statement
  428.        above is saying, in English: "If the value of the variable named
  429.        response is equal to @YES, then run the program SOL.EXE."  If you used
  430.        a single equal sign (=) here by mistake, you would get an error
  431.        message:
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.        Which is WIL's way of telling you to re-check your syntax.
  440.  
  441.        If you've become confused, just remember that a single equal sign (=)
  442.        is an assignment operator, used to assign a value to a variable.
  443.        Double equal signs (==) are an equality operator, used to test whether
  444.        the values on both sides of the operator are the same.  If you have a
  445.        problem with one of your WIL files, make sure to check whether you've
  446.        used one of these symbols incorrectly.  It's a very common mistake,
  447.        which is why we emphasize it so strongly!
  448.  
  449.        We've seen what happens when the condition following the Then keyword
  450.        is true.  But what happens when it is false?  Remember we said that
  451.        when the If condition is false, the Then statement is ignored.  There
  452.        will be times, however when we want to perform an alternate action in
  453.        this circumstance.  For example, suppose we want to display a message
  454.        if the user decides that he or she doesn't want to play Solitaire.  We
  455.        could write:
  456.  
  457.         response = AskYesNo("Really?", "Play Solitaire now?")
  458.         If response == @YES Then Run("sol.exe", "")
  459.         If response == @NO Then Display(5, "", "Game canceled")
  460.  
  461.        In this case there are two If statements being evaluated, with one and
  462.        only one of them possibly being true (unless the user selects Cancel,
  463.        which would abort the batch file entirely).  However, this is
  464.        inefficient from a processing standpoint.  Furthermore, what would
  465.        happen if you had several functions you wanted to perform if the user
  466.        answered Yes?  You would end up with something unwieldy:
  467.  
  468.         response = AskYesNo("Really?", "Play Solitaire now?")
  469.         If response == @YES Then Display(5, "", "On your mark ...")
  470.         If response == @YES Then Display(5, "", "Get set ...")
  471.         If response == @YES Then Display(5, "", "Go!")
  472.         If response == @YES Then Run("sol.exe", "")
  473.  
  474.        Clearly, there must be a better way of handling this.
  475.  
  476.  
  477.  
  478.  
  479.        Branching
  480.        Enter the Goto command.  Goto, in combination with If ... Then, gives
  481.        you the ability to redirect the flow of control in your WIL files.
  482.        Goto does exactly what it says -- it causes the flow of control to go
  483.        to another point in the batch file.  You must specify where you want
  484.        the flow of control to be transferred, and you must mark this point
  485.        with a label.  A label is simply a destination address, or marker.
  486.        The form of the Goto command is:
  487.  
  488.           Goto label
  489.  
  490.        where label is an identifier that you specify.  The same rules apply
  491.        to label names as to variable names (the first character must be a
  492.        letter, the label name may consist of any combination of letters and
  493.        numbers, and the label name may be from 1 to 30 characters long).  In
  494.  
  495.  
  496.  
  497.  
  498.  
  499.        addition, the label is preceded by a colon (:) at the point where it
  500.        is being used as a destination address.  Here's an example:
  501.  
  502.         response = AskYesNo("Really?", "Play Solitaire now?")
  503.         If response == @NO Then Goto quit
  504.         Display(5, "", "On your mark ...")
  505.         Display(5, "", "Get set ...")
  506.         Display(5, "", "Go!")
  507.         Run("sol.exe", "")
  508.         :quit
  509.  
  510.        If the If condition is true (that is, if the user answers No), then
  511.        the Goto statement is performed.  The Goto statement is saying, in
  512.        English "go to the line marked :quit, and continue processing from
  513.        there."  Notice how the label quit is preceded by a colon on the last
  514.        line, but not on the line where it follows the Goto keyword.  This is
  515.        important.  Although you can have multiple lines in your batch file
  516.        which say Goto quit, you can have only one line marked :quit (just
  517.        like you can have several people going to your house, but can have
  518.        only one house with a particular address).  Of course, you can use
  519.        many different labels in a batch file, just as you can use many
  520.        different variables, as long as each has a unique name.  For example:
  521.  
  522.         response = AskYesNo("Really?", "Play Solitaire now?")
  523.         If response == @NO Then Goto quit
  524.         Display(5, "", "On your mark ...")
  525.         Display(5, "", "Get set ...")
  526.         Display(5, "", "Go!")
  527.         Run("sol.exe", "")
  528.         Goto done
  529.         :quit
  530.         Display(5, "", "Game canceled")
  531.         :done
  532.  
  533.        This is a little more complicated.  It uses two labels, quit and done.
  534.        If the user answers No, then the If condition is true, control passes
  535.        to the line marked :quit, and a message is displayed.  If, on the
  536.        other hand, the user answers Yes, then the If condition is false, and
  537.        the Goto quit line is ignored.  Instead, the next four lines are
  538.        processed, and then the Goto done statement is performed.  The purpose
  539.        of this line is to bypass the Display line which follows, by
  540.        transferring control to the end of the batch file.  There is another
  541.        way to keep your batch file processing from "falling through" to
  542.        unwanted lines at the end of a program, and that is with the Exit
  543.        command.  Exit causes a batch file to end immediately.  So, for
  544.        example, we could rewrite the above batch file as follows:
  545.  
  546.         response = AskYesNo("Really?", "Play Solitaire now?")
  547.         If response == @NO Then Goto quit
  548.         Display(5, "", "On your mark ...")
  549.         Display(5, "", "Get set ...")
  550.         Display(5, "", "Go!")
  551.         Run("sol.exe", "")
  552.         Exit
  553.         :quit
  554.         Display(5, "", "Game canceled")
  555.  
  556.  
  557.  
  558.  
  559.  
  560.        Since the Run function is the last thing we want to do if the user
  561.        answers Yes, the Exit command simply ends the program at that point.
  562.        Note that we could put an Exit command at the end of the program as
  563.        well, but it isn't necessary.  An Exit is implied at the end of a WIL
  564.        program.
  565.  
  566.  
  567.  
  568.        This concludes the first part of our tutorial.  You now have the
  569.        building blocks you need to create useful WIL files.  In the second
  570.        part, which follows, we will look in more detail at some of the WIL
  571.        functions which are available for your use.
  572.  
  573.  
  574.  
  575.  
  576.        Exploring WIL
  577.        What follows is just a sample of the many functions and commands
  578.        available in WIL.  These should be sufficient to begin creating
  579.        versatile and powerful batch files.  For complete information on these
  580.        and all WIL functions and commands, refer to the WIL Function
  581.        Reference (pg. 55).
  582.  
  583.  
  584.  
  585.  
  586.        Running Programs
  587.        There are three functions which you can use to start an application,
  588.        each of which shares a common syntax:
  589.  
  590.  
  591.        Run (program-name, parameters)
  592.        We've already seen the Run function.  This function starts a program
  593.        in a "normal" window.  Windows decides where to place the
  594.        application's  window on the screen.
  595.  
  596.        Example:
  597.         Run("notepad.exe", "myfile.txt")
  598.  
  599.        If the program has an EXE extension, its extension may be omitted:
  600.  
  601.         Run("notepad", "myfile.txt")
  602.  
  603.        Also, you can "run" data files if they have an extension in WIN.INI
  604.        which is associated with an executable program.  So, if TXT files are
  605.        associated with Notepad:
  606.  
  607.         Run("myfile.txt", "")
  608.  
  609.        would start Notepad, using the file MYFILE.TXT.
  610.  
  611.        When you specify a file to run, WIL looks first in the current
  612.        directory, and then in the directories on your DOS path.  If the file
  613.        is not found, WIL will return an error.  You can also specify a full
  614.        path name for WIL to use, as in:
  615.  
  616.         Run("c:\windows\apps\winedit.exe", "")
  617.  
  618.  
  619.  
  620.  
  621.  
  622.  
  623.        RunZoom (program-name, parameters)
  624.        RunZoom is like Run, but starts a program as a full-screen window.
  625.  
  626.        Example:
  627.         RunZoom("excel", "bigsheet.xls")
  628.  
  629.        RunIcon (program-name, parameters)
  630.        RunIcon starts a program as an icon at the bottom of the screen.
  631.  
  632.        Example:
  633.         RunIcon("clock", "")
  634.  
  635.  
  636.  
  637.        Display and Input
  638.        Here we have functions which display information to the user and
  639.        prompt the user for information, plus a couple of relevant system
  640.        functions.
  641.  
  642.  
  643.        Display (seconds, title, text)
  644.        Displays a message to the user for a specified period of time.  The
  645.        message will disappear after the time expires, or after any keypress
  646.        or mouse click.
  647.  
  648.        Example:
  649.         Display(2, "", "Loading Solitaire now")
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.        Message (title, text)
  659.        This command displays a message box with a title and text you specify,
  660.        which will remain on the screen until the user presses the OK button.
  661.  
  662.        Example:
  663.         Message("Sorry", "That file cannot be found")
  664.  
  665.  
  666.  
  667.  
  668.  
  669.  
  670.  
  671.  
  672.  
  673.  
  674.        Pause (title, text)
  675.        This command is similar to Message, except an exclamation-point icon
  676.        appears in the message box, and the user can press OK or Cancel.  If
  677.        the user presses Cancel, the batch file exits.
  678.  
  679.  
  680.  
  681.  
  682.  
  683.        Example:
  684.         Pause("Delete Backups", "Last chance to stop!")
  685.         ; if batch file gets this far, the user pressed OK
  686.         FileDelete("*.bak")
  687.  
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.        AskYesNo (title, question)
  698.        Displays a dialog box with a given title, which presents the user with
  699.        three buttons: Yes, No, and Cancel.  If the user selects the Cancel
  700.        button, the batch file is terminated.
  701.  
  702.        Example:
  703.         response = AskYesNo("End Session", "Really quit Windows?")
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.        AskLine (title, prompt, default)
  715.        Displays a dialog box with a given title, which prompts the user for a
  716.        line of input.  Returns the default if the user just presses the OK
  717.        button.
  718.  
  719.        Example:
  720.         yourfile = AskLine("Edit File", "Filename:", "newfile.txt")
  721.         Run("notepad", yourfile)
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.  
  734.  
  735.  
  736.        If you specify a default value (as we have with NEWFILE.TXT), it will
  737.        appear in the response box, and will be replaced with whatever the
  738.        user types.  If the user doesn't type anything, the default is used.
  739.  
  740.  
  741.  
  742.  
  743.  
  744.  
  745.        Beep
  746.        Beeps once.
  747.  
  748.         Beep
  749.  
  750.        And if one beep isn't enough for you:
  751.  
  752.         Beep
  753.         Beep
  754.         Beep
  755.  
  756.        Delay (seconds)
  757.        Pauses batch file execution.
  758.  
  759.        The Delay function lets you suspend batch file processing for 1 to 15
  760.        seconds.  You can use multiple occurrences for a longer delay:
  761.  
  762.         Delay(15)
  763.         Delay(15)
  764.  
  765.        Will insert a 30-second pause.
  766.  
  767.  
  768.  
  769.  
  770.        Manipulating Windows
  771.        There are a large number of functions which allow you to manage the
  772.        windows on your desktop.  Here are some of them:
  773.  
  774.  
  775.        WinZoom (partial-windowname)
  776.        Maximizes an application window to full-screen.
  777.  
  778.  
  779.        WinIconize (partial-windowname)
  780.        Turns an application window into an icon.
  781.  
  782.  
  783.        WinShow (partial-windowname)
  784.        Shows a window in its "normal" state.
  785.  
  786.  
  787.  
  788.        These three functions are used to modify the size of an already-
  789.        running window.  WinZoom is the equivalent of selecting Maximize from
  790.        a window's control menu, WinIconize is like selecting Minimize, and
  791.        WinShow is like selecting Restore.
  792.  
  793.        The window on which you are performing any of these functions does not
  794.        have to be the active window.  If the specified window is in the
  795.        background, and a WinZoom or WinShow function causes the size of the
  796.        window to change, then the window will be brought to the foreground.
  797.        The WinZoom function has no effect on a window which is already
  798.        maximized; likewise, WinShow has no effect on a window which is
  799.        already "normal."
  800.  
  801.  
  802.  
  803.  
  804.  
  805.        Each of these functions accepts a partial windowname as a parameter.
  806.        The windowname is the name which appears in the title bar at the top
  807.        of the window.  You can specify the full name if you wish, but it may
  808.        often be advantageous not to have to do so.  For example, if you are
  809.        editing the file SOLITARE.WBT in a Notepad window, the windowname will
  810.        be Notepad - SOLITARE.WBT:
  811.  
  812.  
  813.  
  814.  
  815.  
  816.  
  817.  
  818.  
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.        You probably don't want to have to hard-code this entire name into
  834.        your batch file as:
  835.  
  836.         WinZoom("Notepad - SOLITARE.WBT")
  837.  
  838.        Instead, you can specify the partial windowname "Notepad":
  839.  
  840.         WinZoom("Notepad")
  841.  
  842.        If you have more than one Notepad window open, WIL will use the one
  843.        which was most recently used or started.
  844.  
  845.        Note that WIL matches the partial windowname beginning with the first
  846.        character, so that while
  847.  
  848.         WinZoom("Note")
  849.  
  850.        would be correct,
  851.  
  852.         WinZoom("pad")
  853.  
  854.        would not result in a match.
  855.  
  856.        Also, the case (upper or lower) of the title is significant, so
  857.  
  858.         WinZoom("notepad")
  859.  
  860.        would not work either.
  861.  
  862.  
  863.  
  864.  
  865.  
  866.  
  867.        WinActivate (partial-windowname)
  868.        Makes an application window the active window.
  869.  
  870.        This function makes a currently-open window the active window.  If the
  871.        specified window is an icon, it will be restored to normal size;
  872.        otherwise, its size will not be changed.
  873.  
  874.  
  875.        WinClose (partial-windowname)
  876.        Closes an application window.
  877.  
  878.        This is like selecting Close from an application's control menu.  You
  879.        will still receive any closing message(s) that the application would
  880.        normally give you, such as an "unsaved-file" dialog box.
  881.  
  882.  
  883.        WinCloseNot (partial-windowname
  884.             [, partial-windowname]...)
  885.        Closes all application windows except those specified.
  886.  
  887.        This function lets you close all windows except the one(s) you want to
  888.        remain open.  For example:
  889.  
  890.         WinCloseNot("Program Man")
  891.  
  892.        would leave only the Program Manager open, and:
  893.  
  894.         WinCloseNot("Program Man", "Solit")
  895.  
  896.        would leave the Program Manager and Solitaire windows open.
  897.  
  898.  
  899.        WinWaitClose (partial-windowname)
  900.        Waits until an application window is closed.
  901.  
  902.        This function causes your WIL file to pause until you have manually
  903.        closed a specified window.  This is a convenient way to get WIL to
  904.        open several windows sequentially, thereby not having unnecessary
  905.        windows all over your desktop.  For example:
  906.  
  907.         RunZoom("invoices.xls", "")       ;balance the books
  908.         WinWaitClose("Microsoft Ex")      ;wait till Excel closed
  909.         RunZoom("sol", "")                     ;you deserve a break
  910.         WinWaitClose("Solitaire")              ;wait until Solit closed
  911.         Run("winword", "agenda.doc")      ;more paperwork
  912.         WinWaitClose("Microsoft Wor")          ;wait until W4W closed
  913.         Run("clock","")                        ;lunchtime yet?
  914.  
  915.        During the time that the batch file is suspended, the WIL icon will
  916.        remain at the bottom of your screen.  You can cancel the batch file at
  917.        any time by selecting Terminate from the icon's control menu.
  918.  
  919.  
  920.        WinExist (partial-windowname)
  921.        Tells if a window exists.
  922.  
  923.  
  924.  
  925.  
  926.  
  927.        This function returns @TRUE or @FALSE, depending on whether a matching
  928.        window can be found.  This provides a way of insuring that only one
  929.        copy of a given window will be open at a time.
  930.  
  931.        If you've been following this tutorial faithfully from the beginning,
  932.        you probably have several copies of Solitaire running at the moment.
  933.        (You can check by pressing Ctrl-Esc and bringing up the Task Manager.
  934.        You say you've got five Solitaire windows open?  Okay, close them
  935.        all.)  Now, let's modify our SOLITARE.WBT file.  First, trim out the
  936.        excess lines so that it looks like this:
  937.  
  938.         Run("sol.exe", "")
  939.  
  940.        Now, let's use the WinExist function to make sure that WIL only starts
  941.        Solitaire if it isn't already running:
  942.  
  943.         If WinExist("Solitaire") == @FALSE Then Run("sol.exe", "")
  944.  
  945.        And this should work fine.  Run SOLITARE.WBT twice now, and see what
  946.        happens.  The first time you run it, it should start Solitaire; the
  947.        second (and subsequent) time, it should not do anything.
  948.  
  949.        However, it's quite likely that you want the batch file to do
  950.        something if Solitaire is already running -- namely, bring the
  951.        Solitaire window to the foreground.  This can be accomplished by using
  952.        the WinActivate function, along with a couple of Goto statements:
  953.  
  954.         If WinExist("Solitaire") == @FALSE Then Goto open
  955.         WinActivate("Solitaire")
  956.         Goto loaded
  957.         :open
  958.         Run("sol.exe", "")
  959.         :loaded
  960.  
  961.        Note that we can change this to have WinExist check for a True value
  962.        instead, by modifying the structure of the batch file:
  963.  
  964.         If WinExist("Solitaire") == @TRUE Then Goto activate
  965.         Run("sol.exe", "")
  966.         Goto loaded
  967.         :activate
  968.         WinActivate("Solitaire")
  969.         :loaded
  970.  
  971.        Either format is perfectly correct, and the choice of which to use is
  972.        merely a matter of personal style.  The result is exactly the same.
  973.  
  974.  
  975.        EndSession ( )
  976.        Ends the current Windows session.
  977.  
  978.        This does exactly what it says.  It will not ask any questions
  979.        (although you will receive any closing messages that your currently-
  980.        open windows would normally display), so you may want to build in a
  981.        little safety net:
  982.  
  983.  
  984.  
  985.  
  986.  
  987.         sure = AskYesNo("End Session", "Really quit Windows?")
  988.         If sure == @YES Then EndSession()
  989.  
  990.        EndSession is an example of a WIL function which does not take any
  991.        parameters, as indicated by the empty parentheses which follow it.
  992.        The parentheses are still required, though.
  993.  
  994.  
  995.  
  996.  
  997.        Files and Directories
  998.  
  999.        DirChange (pathname)
  1000.        Changes the directory to the pathname specified.
  1001.  
  1002.        Use this function when you want to run a program which must be started
  1003.        from its own directory.  "Pathname" may optionally include a drive
  1004.        letter.
  1005.  
  1006.        Example:
  1007.         DirChange("c:\windows\winword")
  1008.         Run("winword.exe", "")
  1009.  
  1010.        DirGet ( )
  1011.        Gets the current working directory.
  1012.  
  1013.        This function is especially useful when used in conjunction with
  1014.        DirChange, to save and then return to the current directory.
  1015.  
  1016.        Example:
  1017.         origdir = DirGet()
  1018.         DirChange("c:\windows\winword")
  1019.         Run("winword.exe", "")
  1020.         DirChange(origdir)
  1021.  
  1022.        FileExist (filename)
  1023.        Determines if a file exists.
  1024.  
  1025.        This function will return @TRUE if the specified file exists, and
  1026.        @FALSE if it doesn't exist.
  1027.  
  1028.        Example:
  1029.         If FileExist("win.bak") == @FALSE Then FileCopy("win.ini", 
  1030.             "win.bak", @FALSE)
  1031.         Run("notepad.exe", "win.ini")
  1032.  
  1033.  
  1034.        FileCopy (from-list, to-file, warning)
  1035.        Copies files.
  1036.  
  1037.        If warning is @TRUE, WinEdit will pop up a dialog box warning you if
  1038.        you are about to overwrite an existing file, and giving you an
  1039.        opportunity to change your mind.  If warning is @FALSE, it will
  1040.        overwrite existing files with no warning.
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.        Example:
  1047.         FileCopy("cmdpost.cpm", "*.sav", @TRUE)
  1048.         Run("notepad.exe", "cmdpost.cpm")
  1049.  
  1050.        The asterisk (*) is a wildcard character, which matches any letter or
  1051.        group of letters in a file name.  In this case, it will cause
  1052.        CMDPOST.CPM to be copied as CMDPOST.SAV.
  1053.  
  1054.  
  1055.        FileDelete (file-list)
  1056.        Deletes files.
  1057.  
  1058.        Example:
  1059.         If FileExist("win.bak") == @TRUE Then FileDelete("win.bak")
  1060.  
  1061.  
  1062.        FileRename (from-list, to-file)
  1063.        Renames files to another set of names.
  1064.  
  1065.  
  1066.  
  1067.        We can illustrate the use of these WIL file functions with a typical
  1068.        batch file application.  Let's suppose that our word processor saves a
  1069.        backup copy of each document, with a BAK extension, but we want a
  1070.        larger safety net when editing important files.  We want to keep the
  1071.        five most recent versions of the wonderful software manual we're
  1072.        writing.  Here's a WIL file to accomplish this:
  1073.  
  1074.         If FileExist("WIL.bak") == @TRUE Then Goto backup
  1075.         :edit
  1076.         Run("winword.exe", "WIL.doc")
  1077.         Exit
  1078.         :backup
  1079.         FileDelete("wil.bk5")
  1080.         FileRename("wil.bk4", "wil.bk5)
  1081.         FileRename("wil.bk3", "wil.bk4)
  1082.         FileRename("wil.bk2", "wil.bk3)
  1083.         FileRename("wil.bk1", "wil.bk2)
  1084.         FileRename("wil.bak", "wil.bk1)
  1085.         Goto edit
  1086.  
  1087.        If the file WINBATCH.BAK exists, it means that we have made a change
  1088.        to WINBATCH.DOC.  So, before we start editing, we delete the oldest
  1089.        backup copy, and perform several FileRename functions, until
  1090.        eventually WINBATCH.BAK becomes WINBATCH.BK1.  Notice how the flow of
  1091.        control moves to the line labeled :backup, and then back to the line
  1092.        labeled :edit, and how we terminate processing with the Exit command.
  1093.        If we did not include the Exit command, the batch file would continue
  1094.        in an endless loop.
  1095.  
  1096.        However, this still isn't quite right.  What would happen if the file
  1097.        WINBATCH.BK5 didn't exist?  In the DOS batch language, we would get an
  1098.        error message, and processing would continue.  But in WIL, the error
  1099.        would be fatal, and cause the batch file to abort:
  1100.  
  1101.  
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.        There are two ways that we can handle this.  We could use an If
  1117.        FileExist test before every file operation, and test the returned
  1118.        value for a @TRUE before proceeding.  But this is clumsy, even with
  1119.        such a small batch file, and would become unwieldy with a larger one.
  1120.  
  1121.  
  1122.  
  1123.  
  1124.        Handling Errors
  1125.        Luckily, there is a WIL system function to help us here: ErrorMode.
  1126.        The ErrorMode function determines what happens if an error occurs
  1127.        during batch file processing.  Here's the syntax:
  1128.  
  1129.  
  1130.        ErrorMode (mode)
  1131.        Specifies how to handle errors.
  1132.  
  1133.  
  1134.        Parameters:
  1135.         "mode" =     @CANCEL, @NOTIFY, or @OFF.
  1136.  
  1137.        Returns:
  1138.         (integer)    previous error setting.
  1139.  
  1140.        Use this command to control the effects of runtime errors.  The
  1141.        default is @CANCEL, meaning the execution of the batch file will be
  1142.        canceled for any error.
  1143.  
  1144.        @CANCEL:  All runtime errors will cause execution to be canceled.  The
  1145.        user will be notified which error occurred.
  1146.  
  1147.        @NOTIFY:  All runtime errors will be reported to the user, and they
  1148.        can choose to continue if it isn't fatal.
  1149.  
  1150.        @OFF:  Minor runtime errors will be suppressed. Moderate and fatal
  1151.        errors will be reported to the user.  User has the option of
  1152.        continuing if the error is not fatal.
  1153.  
  1154.        As you can see, the default mode is @CANCEL, and it's a good idea to
  1155.        leave it like this.  However, it is quite reasonable to change the
  1156.        mode for sections of your batch files where you anticipate errors
  1157.        occurring.  This is just what we've done in our modified batch file:
  1158.  
  1159.  
  1160.  
  1161.  
  1162.  
  1163.         If FileExist("wil.bak") == @TRUE Then Goto backup
  1164.         :edit
  1165.         Run("winword.exe", "wil.doc")
  1166.         Exit
  1167.         :backup
  1168.         ErrorMode(@OFF)
  1169.         FileDelete("wil.bk5")
  1170.         FileRename("wil.bk4", "wil.bk5)
  1171.         FileRename("wil.bk3", "wil.bk4)
  1172.         FileRename("wil.bk2", "wil.bk3)
  1173.         FileRename("wil.bk1", "wil.bk2)
  1174.         FileRename("wil.bak", "wil.bk1)
  1175.         ErrorMode(@CANCEL)
  1176.         Goto edit
  1177.  
  1178.        Notice how we've used ErrorMode(@OFF) to prevent errors in the section
  1179.        labeled backup: from aborting the batch file, and then used
  1180.        ErrorMode(@CANCEL) at the end of the that section to change back to
  1181.        the default error mode.  This is a good practice to follow.
  1182.  
  1183.  
  1184.  
  1185.  
  1186.        Selection Menus
  1187.        So far, whenever we have needed to use a file name, we have hard-coded
  1188.        it into our WIL files.  For example:
  1189.  
  1190.         Run("notepad.exe", "agenda.txt")
  1191.  
  1192.        Naturally, there should be a way to get this information from the user
  1193.        "on the fly", so that we wouldn't have to write hundreds of different
  1194.        batch files.  And there is a way.  Two ways, actually.  Consider,
  1195.        first, a function that we have already seen, AskLine:
  1196.  
  1197.         file = AskLine("", "Enter Filename to edit?", "")
  1198.         Run("notepad.exe", file)
  1199.  
  1200.        This will prompt for a filename, and run Notepad on that file:
  1201.  
  1202.  
  1203.  
  1204.  
  1205.  
  1206.  
  1207.  
  1208.  
  1209.  
  1210.  
  1211.  
  1212.  
  1213.  
  1214.  
  1215.  
  1216.        There are only three problems with this approach.  First, the user
  1217.        might not remember the name of the file.  Second, the user might enter
  1218.        the name incorrectly.  And finally, modern software is supposed to be
  1219.  
  1220.  
  1221.  
  1222.  
  1223.  
  1224.        sophisticated and user-friendly enough to handle these things the
  1225.        right way.  And WIL certainly can.
  1226.  
  1227.        There are two new functions we need to use for our new, improved file
  1228.        selection routine: FileItemize and ItemSelect.
  1229.  
  1230.  
  1231.        FileItemize (file-list)
  1232.        Returns a space-delimited list of files.
  1233.  
  1234.        This function compiles a list of filenames and separates the names
  1235.        with spaces.  There are several variations we can use:
  1236.  
  1237.         FileItemize("*.doc")
  1238.  
  1239.        would give us a list of all files in the current directory with a DOC
  1240.        extension,
  1241.  
  1242.         FileItemize("*.com *.exe")
  1243.  
  1244.        would give us a list of all files in the current directory with a COM
  1245.        or EXE extension, and
  1246.  
  1247.         FileItemize("*.*")
  1248.  
  1249.        would give us a list of all files in the current directory.
  1250.  
  1251.        Of course, we need to be able to use this list, and for that we use:
  1252.  
  1253.  
  1254.        ItemSelect (title, list, delimiter)
  1255.        Displays a listbox filled with items from a list you specify in a
  1256.        string.  The items are separated in your string by a delimiter
  1257.        character.
  1258.  
  1259.        This is the function which actually displays the list box.  Remember
  1260.        that FileItemize returns a file list delimited by spaces, which would
  1261.        look something like this:
  1262.  
  1263.           FILE1.DOC FILE2.DOC FILE3.DOC
  1264.  
  1265.        When we use ItemSelect, we need to tell it that the delimiter is a
  1266.        space.  We do this as follows:
  1267.  
  1268.         textfiles = FileItemize("*.doc *.txt")
  1269.         yourfile = ItemSelect("Select file to edit", textfiles, " ")
  1270.         Run("notepad.exe", yourfile)
  1271.  
  1272.  
  1273.  
  1274.  
  1275.  
  1276.  
  1277.  
  1278.  
  1279.  
  1280.  
  1281.  
  1282.  
  1283.  
  1284.  
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290.  
  1291.  
  1292.  
  1293.  
  1294.        First, we use FileItemize to build a list of filenames with DOC and
  1295.        TXT extensions.  We assign this list to the variable textfiles.  Then,
  1296.        we use the ItemSelect function to build a list box, passing it the
  1297.        variable textfiles as its second parameter.  The third parameter we
  1298.        use for ItemSelect is simply a space with quote marks around it; this
  1299.        tells ItemSelect that the variable textfiles is delimited by spaces.
  1300.        Note that this is different from the null string that we've seen
  1301.        earlier -- here, you must include a space between the quote marks.
  1302.        Finally, we assign the value returned by ItemSelect to the variable
  1303.        yourfile, and run Notepad using that file.
  1304.  
  1305.        In the list box, if the user presses Enter or clicks on the OK button
  1306.        without a file being highlighted, ItemSelect returns a null string.
  1307.        If you want, you can test for this condition:
  1308.  
  1309.         textfiles = FileItemize("*.doc *.txt")
  1310.         :retry
  1311.         yourfile = ItemSelect("Select file to edit", textfiles, " ")
  1312.         If yourfile == "" Then Goto retry
  1313.         Run("notepad.exe", yourfile)
  1314.  
  1315.        DirItemize (dir-list)
  1316.        Returns a space-delimited list of directories.
  1317.  
  1318.        This function is similar to FileItemize, but instead of returning a
  1319.        list of files, it returns a list of directories.  Remember we said
  1320.        that FileItemize only lists files in the current directory.  Often, we
  1321.        want to be able to use files in other directories as well.  We can do
  1322.        this by first letting the user select the appropriate directory, using
  1323.        the DirItemize and ItemSelect combination:
  1324.  
  1325.         DirChange("\")
  1326.         subdirs = DirItemize("*")
  1327.         targdir = ItemSelect("Select dir", subdirs, " ") 
  1328.             DirChange(targdir)
  1329.         files = FileItemize("*.*")
  1330.         file = ItemSelect("Select file", files, " ")
  1331.         Run("notepad.exe", file)
  1332.  
  1333.  
  1334.  
  1335.  
  1336.  
  1337.        First we change to the root directory.  Then we use DirItemize to get
  1338.        a list of all the subdirectories off of the root directory.  Next, we
  1339.        use ItemSelect to give us a list box of directories from which to
  1340.        select.  Finally, we change to the selected directory, and use
  1341.        FileItemize and ItemSelect to pick a file.
  1342.  
  1343.        Although this batch file works, it needs to be polished up a bit.
  1344.        What happens if the file we want is in the \WINDOWS\BATCH directory?
  1345.        Our batch file doesn't go more than one level deep from the root
  1346.        directory.  We want  to continue down the directory tree, but we also
  1347.        need a way of telling when we're at the end of a branch.  As it
  1348.        happens, there is such a way: DirItemize will return a null string if
  1349.        there are no directories to process.  Given this knowledge, we can set
  1350.        up a loop to test when we are at the lowest level:
  1351.  
  1352.         DirChange("\")
  1353.         :getdir
  1354.         subdirs = DirItemize("*")
  1355.         If subdirs == "" Then Goto getfile
  1356.         targdir = ItemSelect("Select dir (OK = curr)", subdirs, " ")
  1357.         If targdir == "" Then Goto getfile
  1358.         DirChange(targdir)
  1359.         Goto getdir
  1360.         :getfile
  1361.         files = FileItemize("*.*")
  1362.         file = ItemSelect("Select file", files, " ")
  1363.         If file == "" Then Goto getfile
  1364.         Run("notepad.exe", file)
  1365.  
  1366.        After we use the DirItemize function, we test the returned value for a
  1367.        null string.  If we have a null string, then we know that the current
  1368.        directory has no subdirectories, and so we proceed to select the
  1369.        filename from the current directory (Goto getfile) .  If, however,
  1370.        DirItemize returns a non-blank list, then we know that there is, in
  1371.        fact, at least one subdirectory.  In that case, we use ItemSelect to
  1372.        present the user with a list box of directories.  Then, we test the
  1373.        value returned by ItemSelect.  If the returned value is a null string,
  1374.        it means that the user did not select a directory from the list, and
  1375.        presumably wants a file in the current directory.  We happily oblige
  1376.        (Goto getfile).  On the other hand, a non-blank value returned by
  1377.        ItemSelect indicates that the user has selected a subdirectory from
  1378.        the list box.  In that case, we change to the selected directory, and
  1379.        loop back to the beginning of the directory selection routine (Goto
  1380.        getdir).  We continue this process until either (a) the user selects a
  1381.        directory, or (b) there are no directories left to select.
  1382.        Eventually, we get to the section of the batch file labeled :getfile.
  1383.  
  1384.  
  1385.  
  1386.  
  1387.        Nicer Display Boxes
  1388.        Have you tried displaying long messages, and found that WIL didn't
  1389.        wrap the lines quite the way you wanted?  Here are a couple of tricks.
  1390.  
  1391.  
  1392.        Num2Char (integer)
  1393.        Converts a number to its character equivalent.
  1394.  
  1395.  
  1396.  
  1397.  
  1398.  
  1399.        We want to be able to insert a carriage return/line feed combination
  1400.        at the end of each line in our output, and the Num2Char function will
  1401.        let us do that.  A carriage return has an ASCII value of 13, and a
  1402.        line feed has an ASCII value of 10 (don't worry if you don't
  1403.        understand what this sentence means).  To be able to use these values,
  1404.        we must convert them to characters, as follows:
  1405.  
  1406.         cr = Num2Char(13)
  1407.         lf = Num2Char(10)
  1408.  
  1409.        Now, we need to be able to place the variables cr and lf in our
  1410.        message.  For example, let's say we want to do this:
  1411.  
  1412.         Message("", "This is line one This is line two")
  1413.  
  1414.        If we just inserted the variables into the string, as in:
  1415.  
  1416.         cr = Num2Char(13)
  1417.         lf = Num2Char(10)
  1418.         Message("", "This is line one cr lf This is line two")
  1419.  
  1420.        we would not get the desired effect.  WIL would simply treat them as
  1421.        ordinary text:
  1422.  
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.        However, WIL does provide us with a method of performing variable
  1435.        substitution such as this, and that is by delimiting the variables
  1436.        with percentage signs (%).  If we do this:
  1437.  
  1438.         cr = Num2Char(13)
  1439.         lf = Num2Char(10)
  1440.         Message("", "This is line one %cr% %lf%This is line two")
  1441.  
  1442.        we will get what we want:
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.        Note that there is no space after %lf%; this is so that the second
  1449.        line will be aligned with the first line (every space within the
  1450.        delimiting quote marks of a string variable is significant).
  1451.  
  1452.        Now, wouldn't it be convenient if we could combine cr and lf into a
  1453.        single variable?  We can.
  1454.  
  1455.  
  1456.        StrCat (string[, string]...)
  1457.        Concatenates strings together.
  1458.  
  1459.        The StrCat function lets us combine any number of string constants
  1460.        and/or string variables.  Here's how we combine the variables cr and
  1461.        lf into the single variable crlf:
  1462.  
  1463.         crlf = StrCat(cr, lf)
  1464.  
  1465.        Note that the strings to be concatenated are separated by commas,
  1466.        within the parentheses.  Now, we can rewrite our example, as follows:
  1467.  
  1468.         cr = Num2Char(13)
  1469.         lf = Num2Char(10)
  1470.         crlf = StrCat(cr, lf)
  1471.         Message("", "This is line one %crlf%This is line two")
  1472.  
  1473.        If we wanted to re-use this message a number of times, it would be
  1474.        quite convenient to use the StrCat function to make a single variable
  1475.        out of it:
  1476.  
  1477.         cr = Num2Char(13)
  1478.         lf = Num2Char(10)
  1479.         crlf = StrCat(cr, lf)
  1480.         line1 = "This is line one"
  1481.         line2 = "This is line two"
  1482.         mytext = StrCat(line1, crlf, line2)
  1483.         Message("", mytext)
  1484.  
  1485.  
  1486.  
  1487.        Even Nicer Display Boxes
  1488.        For fancy dialog boxes, complete with all the bells and whistles, see
  1489.        the separate manual section on the DialogBox function (pg. 185).
  1490.  
  1491.  
  1492.  
  1493.  
  1494.        Running DOS Programs
  1495.        WIL can run DOS programs, just like it runs Windows programs:
  1496.  
  1497.         DirChange("c:\game")
  1498.         Run("scramble.exe", "")
  1499.  
  1500.        If you want to use an internal DOS command, such as DIR or TYPE, you
  1501.        can do so by running the DOS command interpreter, COMMAND.COM, with
  1502.        the /c program parameter, as follows:
  1503.  
  1504.         Run("command.com", "/c type readme.txt")
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.        Everything that you would normally type on the DOS command line goes
  1512.        after the /c in the second parameter.  Here's another example:
  1513.  
  1514.         Run("command.com", "/c type readme.txt | more")
  1515.  
  1516.        These examples assume that COMMAND.COM is in a directory on your DOS
  1517.        path.  If it isn't, you could specify a full path name for it:
  1518.  
  1519.         Run("c:\command.com", "/c type readme.txt | more")
  1520.  
  1521.        Or, better still, you could use the WIL Environment function.
  1522.  
  1523.  
  1524.        Environment (env-variable)
  1525.        Gets a DOS environment variable.
  1526.  
  1527.        Since DOS always stores the full path and filename of the command
  1528.        processor in the DOS environment variable COMSPEC, it is an easy
  1529.        matter to retrieve this information:
  1530.  
  1531.         coms = Environment("COMSPEC")
  1532.  
  1533.        and use it in our batch file:
  1534.  
  1535.         coms = Environment("COMSPEC")
  1536.         Run(coms, "/c type readme.txt")
  1537.  
  1538.        To get a DOS window, just run COMMAND.COM with no parameters:
  1539.  
  1540.         coms = Environment("COMSPEC")
  1541.         Run(coms, "")
  1542.  
  1543.  
  1544.  
  1545.        Sending Keystrokes to Programs
  1546.        Here we come to one of the most useful and powerful features of WIL:
  1547.        the ability to send keystrokes to Windows programs, just as if you
  1548.        were typing them directly from the keyboard.
  1549.  
  1550.  
  1551.        SendKey (character-codes)
  1552.        Sends keystrokes to the active application.
  1553.  
  1554.        This is an ideal way to make the computer automatically type the
  1555.        keystrokes that you enter every time you start a certain program.  For
  1556.        example, to start up Notepad and have it prompt you for a file to
  1557.        open, you would use:
  1558.  
  1559.         Run("notepad.exe", "")
  1560.         SendKey("!FO")
  1561.  
  1562.        The parameter you specify for SendKey is the string that you want sent
  1563.        to the program.  This string consists of standard characters, as well
  1564.        as some special characters which you will find listed under the entry
  1565.        for SendKey in the WIL Function Reference (pg. 145).  In the example
  1566.        above, the exclamation mark (!) stands for the Alt key, so !F is the
  1567.  
  1568.  
  1569.  
  1570.  
  1571.  
  1572.        equivalent of pressing and holding down the Alt key while
  1573.        simultaneously pressing the F key.  The O in the example above is
  1574.        simply the letter O, and is the same as pressing the O key by itself:
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580.  
  1581.  
  1582.  
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588.  
  1589.  
  1590.        Here's another example:
  1591.  
  1592.         RunZoom("sol.exe", "")
  1593.         SendKey("!GC{RIGHT}{SP}~")
  1594.  
  1595.        This starts up Solitaire, brings up the Game menu (!G), and selects
  1596.        Deck (C) from that menu:
  1597.  
  1598.  
  1599.  
  1600.  
  1601.  
  1602.  
  1603.  
  1604.  
  1605.  
  1606.  
  1607.  
  1608.  
  1609.  
  1610.        Then it moves the cursor to the next card back style on the right
  1611.        ({RIGHT}), selects that card back ({SP}), and then selects OK (~).
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619.        And voila!  A different card design every time you play!
  1620.  
  1621.  
  1622.  
  1623.  
  1624.        Our Completed WIL File
  1625.        Here is the final working version of the SOLITARE.WBT file that we've
  1626.        slowly been building throughout this tutorial:
  1627.  
  1628.         ; solitare.wbt
  1629.         mins = AskLine("Solitaire", "How many minutes do you want to 
  1630.             play?", "")
  1631.         If WinExist("Solitaire") == @TRUE Then Goto activate
  1632.         RunZoom("sol.exe", "")
  1633.         Goto loaded
  1634.         :activate
  1635.         WinActivate("Solitaire")
  1636.         WinZoom("Solitaire")
  1637.         :loaded
  1638.         SendKey("!GC{RIGHT}{SP}~")
  1639.         goal = mins * 60
  1640.         timer = 0
  1641.         :moretime
  1642.         remain = goal - timer
  1643.         WinTitle("Solitaire", "Solitaire (%remain% seconds left)")
  1644.         Delay(10)
  1645.         timer = timer + 10
  1646.         If WinExist("Solitaire") == @FALSE Then Exit
  1647.         If timer < goal Then Goto moretime
  1648.         Beep
  1649.         WinClose("Solitaire")
  1650.         Message("Time's up", "Get back to work!")
  1651.  
  1652.        It incorporates many of the concepts that we've discussed so far, as
  1653.        well as using some arithmetic (*, -, +) and relational (<) operators
  1654.        that are covered in the section on the WIL Language (pg. 1).
  1655.  
  1656.        It can also be improved and customized in a number of ways.
  1657.  
  1658.        If you can understand and follow the structures and processes
  1659.        illustrated in this sample file, and can begin to incorporate them
  1660.        into your own WIL files, you are well on your way to becoming a true
  1661.        WIL guru!
  1662.  
  1663.  
  1664.  
  1665.  
  1666.  
  1667.  
  1668.                                     WIL LANGUAGE
  1669.  
  1670.  
  1671.  
  1672.  
  1673.        **Menu Structure
  1674.        Menus are defined in a menu file.  Each menu file consists of one or
  1675.        more lines of menu statements.  Each line is terminated with a
  1676.        carriage return / line feed (CRLF) combination and can be up to 256
  1677.        characters long.
  1678.  
  1679.        There are two main parts of a menu file:
  1680.  
  1681.        The first section, which is optional, is the initialization code.
  1682.        This section is executed once when the menu is first loaded and run.
  1683.        It's located before the first menu item declaration.
  1684.  
  1685.        The remainder of the menu file consists of menu item titles and their
  1686.        associated statements.  The code under each menu title is executed
  1687.        when the corresponding menu item is selected.  Execution begins at the
  1688.        first statement under a menu item and continues up to the definition
  1689.        of the next item.
  1690.  
  1691.  
  1692.  
  1693.  
  1694.        **Menu Items
  1695.        Menu titles can consist of letters, digits, spaces, punctuation marks;
  1696.        in fact any displayable ANSI characters your text editor can create.
  1697.  
  1698.        There are special characters you can use to modify the appearance of
  1699.        items in the menus.
  1700.  
  1701.        &    Causes the following character to be underlined in the menu item.
  1702.        The user can select the item by pressing the ALT key with the
  1703.        character instead of using the mouse.
  1704.  
  1705.        |  In a main menu, puts this item on a new line.
  1706.        |  In a dropdown menu, this item starts a new column.
  1707.        _  Used to create a horizontal bar (in dropdown menus only).
  1708.  
  1709.        Most WIL commands carry out functions based on your menu selections.
  1710.        However there are a few functions (summarized on pg. Error! Bookmark
  1711.                                                             Error! Bookmark
  1712.                                                             Error! Bookmark
  1713.        not defined.
  1714.        not defined.
  1715.        not defined.) that can alter the characteristics of the menu titles
  1716.        themselves.  For instance you can put a checkmark next to a menu, or
  1717.        disable and gray it.
  1718.  
  1719.        In order to identify a menu item within a WIL statement, each menu
  1720.        item you define has an associated menu name.  The menu name is built
  1721.        using only the letters and digits that make up the menu title.  Menu
  1722.        names are case-insensitive; you don't have to worry about how the
  1723.        actual menu title is capitalized in order to identify it.
  1724.  
  1725.        For menu items in a popup menu, the menu name consists of its parent
  1726.        menu's name, plus the popup menu item's name concatenated at the end.
  1727.  
  1728.  
  1729.  
  1730.  
  1731.  
  1732.        These menu names are valid as soon as the menu file is loaded, so you
  1733.        can use the menu management functions in the initialization code
  1734.        before the menus even appear.
  1735.  
  1736.        Example:
  1737.             PW=AskLine ("","Enter your password:", "")
  1738.             ;assuming the resident guru's pw is already in WIN.INI:
  1739.             RealPW = IniRead ("Our Company", "Tech Guru PW", "")
  1740.             Terminate (PW==RealPW, "Access", "You have FULL access")
  1741.  
  1742.             MenuChange("SystemUtilitiesCleanupDir",  @DISABLE)
  1743.             MenuChange("SystemUtilitiesEditBatFiles",@DISABLE)
  1744.             MenuChange("SystemUtilitiesEditWinIni",  @DISABLE)
  1745.             Message ("Access", "You have LIMITED access")
  1746.  
  1747.         &System Utilities  ;name = "SystemUtilities"
  1748.          &Cleanup Dir      ;name = "SystemUtilitiesCleanupDir"
  1749.             ...
  1750.          &Edit BAT Files...;name = "SystemUtilitiesEditBatFiles"
  1751.             ...
  1752.          &Edit WIN.INI     ;name = "SystemUtilitiesEditWinIni"
  1753.             ...
  1754.  
  1755.  
  1756.  
  1757.        Language Components
  1758.        WIL statements are constructed from constants, variables, operators,
  1759.        functions, commands, and comments.
  1760.  
  1761.        Each line in a WIL program can be up to 255 characters long.
  1762.  
  1763.  
  1764.  
  1765.  
  1766.        Constants
  1767.        The programming language supports both integer and string constants.
  1768.  
  1769.  
  1770.        Integer Constants
  1771.        Integer constants are built from the digits 0 through 9.  They can
  1772.        range in magnitude from negative to positive 231 -1  (approximately
  1773.        two billion).  Constants larger than these permissible magnitudes will
  1774.        produce unpredictable results.
  1775.  
  1776.        Examples of integer constants:
  1777.  
  1778.         1
  1779.         -45
  1780.         377849
  1781.         -1999999999
  1782.  
  1783.        String Constants
  1784.        String constants are comprised of displayable characters bounded by
  1785.        quote marks.  You can use double quotes ("), single quotes ('), or
  1786.        back quotes (`) to enclose a string constant, as long as the same type
  1787.        of quote is used to both start and end it.  If you need to embed the
  1788.  
  1789.  
  1790.  
  1791.  
  1792.  
  1793.        delimiting quote mark inside the string constant, use the delimiting
  1794.        quote mark twice.
  1795.  
  1796.        Examples of string constants:
  1797.  
  1798.         "a"
  1799.         `Betty Boop`
  1800.         "This constant has an embedded "" mark"
  1801.         'This constant also has an embedded " mark'
  1802.  
  1803.        Predefined Constants
  1804.        The programming language has a number of built-in integer constants
  1805.        that can be used for various purposes.  These start with the @-sign,
  1806.        and are case-insensitive (although we prefer to use ALL CAPS).
  1807.  
  1808.        Some predefined constants:
  1809.  
  1810.           @FALSE                              @TILE
  1811.           @NO                                 @TRUE
  1812.           @STACK                              @YES
  1813.  
  1814.  
  1815.  
  1816.        A list of all the predefined constants can be found in Appendix A (pg.
  1817.        185).
  1818.  
  1819.  
  1820.  
  1821.  
  1822.        Identifiers
  1823.        Identifiers are the names supplied for variables, functions, and
  1824.        commands in your program.
  1825.  
  1826.        An identifier is a sequence of one or more letters or digits that
  1827.        begins with a letter.  Identifiers may have up to 30 characters.
  1828.  
  1829.        All identifiers are case insensitive.  Upper- and lowercase characters
  1830.        may be mixed at will inside variable names, commands or functions.
  1831.  
  1832.        For example, these statements all mean the same thing:
  1833.  
  1834.         AskLine(MyTitle, Prompt, Default)
  1835.         ASKLINE(MYTITLE, PROMPT, DEFAULT)
  1836.         aSkLiNe(MyTiTlE, pRoMpT, dEfAuLt)
  1837.  
  1838.  
  1839.  
  1840.        Variables
  1841.        A variable may contain an integer, a string, a list, or a string
  1842.        representing an integer.  Automatic conversions between integers and
  1843.        strings are performed as a matter of course during execution.
  1844.  
  1845.        If a function requires a string parameter and an integer parameter is
  1846.        supplied, the variable will be automatically modified to include the
  1847.        representative string.
  1848.  
  1849.  
  1850.  
  1851.  
  1852.  
  1853.        If a function requires an integer parameter and a string parameter is
  1854.        supplied, an attempt will be made to convert the string to an integer.
  1855.        If it does not convert successfully, an error will result.
  1856.  
  1857.  
  1858.  
  1859.  
  1860.        Keywords
  1861.        "Keywords" are the predefined identifiers that have special meaning to
  1862.        the programming language.  These cannot be used as variable names.
  1863.  
  1864.        WIL keywords consist of the functions, commands, and predefined
  1865.        constants.
  1866.  
  1867.        Some examples of reserved keywords:
  1868.  
  1869.           Beep
  1870.           DirChange
  1871.           @Yes
  1872.           FileCopy
  1873.  
  1874.  
  1875.  
  1876.        Operators
  1877.        The programming language operators take one operand ("unary
  1878.        operators") or two operands ("binary operators").
  1879.  
  1880.        Unary operators (integers only):
  1881.           -      Arithmetic Negation (Two's complement)
  1882.           +      Identity (Unary plus)
  1883.           ~      Bitwise Not.  Changes each 0 bit to 1, and vice-versa.
  1884.           !      Logical Not.  Produces 0 (@FALSE) if the operand is nonzero,
  1885.                  else 1 (@TRUE) if the operand is zero.
  1886.  
  1887.  
  1888.        Binary arithmetic operators (integers only):
  1889.           *      Multiplication
  1890.           /      Division
  1891.           mod    Modulo
  1892.           +      Addition
  1893.           -      Subtraction
  1894.           <<     Left Shift
  1895.           >>     Right Shift
  1896.           &      Bitwise And
  1897.           |      Bitwise Or
  1898.           ^      Bitwise Exclusive Or  (XOR)
  1899.           &&     Logical And
  1900.           | |    Logical Or
  1901.  
  1902.  
  1903.        Binary relational operators (integers and strings):
  1904.           >      Greater-than
  1905.           >=     Greater-than or equal
  1906.           <      Less-than
  1907.           <=     Less-than or equal
  1908.           ==     Equality
  1909.           != or <>    Inequality
  1910.  
  1911.  
  1912.  
  1913.  
  1914.  
  1915.        Assignment operator (integers and strings):
  1916.           =      Assigns evaluated result of an expression to a variable
  1917.  
  1918.  
  1919.  
  1920.  
  1921.        Precedence and evaluation order
  1922.        The precedence of the operators affect the evaluation of operands in
  1923.        expressions.  Operands associated with higher-precedence operators are
  1924.        evaluated before the lower-precedence operators.
  1925.  
  1926.        The table below shows the precedence of the operators.  Where
  1927.        operators have the same precedence, they are evaluated from left to
  1928.        right.
  1929.  
  1930.        Operator            Description
  1931.           ( )              Parenthetical grouping
  1932.           ~ ! - +          Unary operators
  1933.           * / mod          Multiplication & Division
  1934.           + -              Addition & Subtraction
  1935.           <<  >>           Shift operators
  1936.           < <= == >= > != <>    Relational operators
  1937.           & ^ |            Bit manipulation operators
  1938.           && ||            Logical operators
  1939.  
  1940.  
  1941.  
  1942.        Comments
  1943.        A comment is a sequence of characters that are ignored when processing
  1944.        a command.  A semicolon (not otherwise part of a string constant)
  1945.        indicates the beginning of a comment.
  1946.  
  1947.        All characters to the right of the semicolon are considered comments,
  1948.        and are ignored.
  1949.  
  1950.        Blank lines are also ignored.
  1951.  
  1952.        Examples of comments:
  1953.         ; This is a comment
  1954.         abc = 5  ; This is also a comment
  1955.  
  1956.  
  1957.  
  1958.        Statements
  1959.  
  1960.        Assignment Statements
  1961.        Assignment statements are used to set variables to specific or
  1962.        computed values.  Variables may be set to integers or strings.
  1963.  
  1964.        Examples:
  1965.         a = 5
  1966.         value = Average(a, 10, 15)
  1967.         location = "Northern Hemisphere"
  1968.         world = StrCat(location, " ", "Southern Hemisphere")
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.        Control Statements
  1976.        Control statements are generally used to execute system management
  1977.        functions and consist of a call to a command without assigning any
  1978.        return values.
  1979.  
  1980.        Examples:
  1981.         Exit
  1982.         Yield
  1983.  
  1984.  
  1985.  
  1986.        Substitution
  1987.        The batch language has a powerful substitution feature which inserts
  1988.        the contents of a string variable into a statement before the line is
  1989.        parsed.
  1990.  
  1991.        To substitute the contents of a variable in the statement, simply put
  1992.        a percent-sign (%) on both sides of the variable name.
  1993.  
  1994.        Examples:
  1995.         mycmd = "DirChange('c:\')"   ;set mycmd to a command
  1996.         %mycmd%                 ;execute the command
  1997.  
  1998.        Or consider this one:
  1999.  
  2000.         IniWrite("PC", "User", "Richard")
  2001.         ...
  2002.         name = IniRead("PC", "User", "somebody")
  2003.         message("", "Thank you, %name%")
  2004.  
  2005.        will produce this message box:
  2006.  
  2007.  
  2008.  
  2009.  
  2010.  
  2011.  
  2012.  
  2013.  
  2014.  
  2015.  
  2016.  
  2017.  
  2018.        The variable substitution feature can be used to simulate an "array"
  2019.        of strings.  For example, if you wanted to read the lines contained in
  2020.        a file into an array of variables named line1 through line# (where #
  2021.        is the line number of the last line in the file), and then write them
  2022.        to a new file in reverse order, you could do so as follows:
  2023.  
  2024.  
  2025.  
  2026.  
  2027.  
  2028.         handle = FileOpen("c:\config.sys", "READ")
  2029.         num = 0
  2030.         :readnext
  2031.         num = num + 1
  2032.         line%num% = FileRead(handle)
  2033.         If line%num% != "*EOF*" Then Goto readnext
  2034.         FileClose(handle)
  2035.         handle = FileOpen("c:\config.rev", "WRITE")
  2036.         :writenext
  2037.         num = num - 1
  2038.         FileWrite(handle, line%num%)
  2039.         If num > 1 Then Goto writenext
  2040.         FileClose(handle)
  2041.         Message("Processing complete", "CONFIG.REV created")
  2042.  
  2043.  
  2044.        To put a single percent-sign (%) on a source line, specify a double
  2045.        percent sign(%%).  This is required even inside quoted strings.
  2046.  
  2047.        Note:  The length of a line, after any substitution occurs, may not
  2048.        exceed 255 characters.
  2049.  
  2050.  
  2051.  
  2052.  
  2053.        **Language Directives
  2054.        A "language directive" is a command to the WIL interpreter, as opposed
  2055.        to a menu statement.  These begin with a pound-sign ("#") in column 1.
  2056.  
  2057.        Currently there is only one directive recognized by Command Post:
  2058.        #NextFile. This directive tells the WIL interpreter to append another
  2059.        .CPM file to the current one before building the menus.  You can
  2060.        append only one extra menu file in this way.
  2061.  
  2062.  
  2063.  
  2064.  
  2065.        Function Parameters
  2066.        Most of the functions and commands in the language require parameters.
  2067.        These come in several types:
  2068.  
  2069.           Integer
  2070.           String
  2071.           List
  2072.           Variable name
  2073.  
  2074.  
  2075.        The interpreter performs automatic conversions between strings and
  2076.        integers, so in general you can use them interchangeably.
  2077.  
  2078.        Integer parameters may be any of the following:
  2079.  
  2080.           An integer (i.e. 23)
  2081.           A string representing an integer (i.e. "23")
  2082.           A variable containing an integer
  2083.           A variable containing a string representing an integer
  2084.  
  2085.  
  2086.  
  2087.  
  2088.  
  2089.        String parameters may be any of the following:
  2090.  
  2091.           A string
  2092.           An integer
  2093.           A variable containing a string
  2094.           A variable containing a list
  2095.           A variable containing an integer
  2096.  
  2097.  
  2098.  
  2099.  
  2100.        Error Handling
  2101.        There are three types of errors that can occur while processing a
  2102.        batch file:  Minor, Moderate, and Fatal.  What happens when an error
  2103.        occurs depends on the current error mode, which is set with the
  2104.        ErrorMode function.
  2105.  
  2106.        There are three possible modes you can specify:
  2107.  
  2108.        @CANCEL
  2109.           User is notified when any error occurs, and then the batch file is
  2110.           canceled.  This is the default.
  2111.  
  2112.        @NOTIFY
  2113.           User is notified when any error occurs, and has option to continue
  2114.           unless the error is fatal.
  2115.  
  2116.        @OFF
  2117.           User is only notified if the error is moderate or fatal.  User has
  2118.           option to continue unless the error is fatal.
  2119.  
  2120.        The function LastError returns the code of the most-recent error
  2121.        encountered during the current batch file.
  2122.  
  2123.        Minor errors are numbered from 1000 to 1999.
  2124.        Moderate errors are numbered from 2000 to 2999.
  2125.        Fatal errors are numbered from 3000 to 3999.
  2126.  
  2127.        Error handling is reset to @CANCEL at the start of each WIL program.
  2128.  
  2129.  
  2130.  
  2131.  
  2132.        The Functions & Statements
  2133.  
  2134.  
  2135.  
  2136.        Inputting Information
  2137.        AskLine (title, prompt, default)
  2138.           Lets user enter a line of information.
  2139.  
  2140.        AskPassword (title, prompt)
  2141.           Prompts the user for a password.
  2142.  
  2143.        AskYesNo (title, question)
  2144.           Lets user choose from Yes, No, or Cancel.
  2145.  
  2146.  
  2147.  
  2148.  
  2149.  
  2150.        ItemSelect (title, list, delimiter)
  2151.           Chooses an item from a listbox.
  2152.  
  2153.        TextBox (title, filename)
  2154.           Fills a listbox from text strings in a file.
  2155.  
  2156.        TextSelect (title, list, delimiter)
  2157.           Allows the user to choose an item from an unsorted listbox.
  2158.  
  2159.  
  2160.  
  2161.  
  2162.        Displaying Information
  2163.        Beep
  2164.           Beeps at the user.
  2165.  
  2166.        DialogBox (title, WDG file)
  2167.           Pops up a Windows dialog box defined by the WDG template file.
  2168.  
  2169.        Display (seconds, title, text)
  2170.           Momentarily displays a string.
  2171.  
  2172.        Message (title, text)
  2173.           Displays text in a message box.
  2174.  
  2175.        Pause (title, text)
  2176.           Displays text in a message box.
  2177.  
  2178.        TextBox (title, filename)
  2179.           Fills a listbox from text strings in a file.
  2180.  
  2181.        TextSelect (title, list, delimiter)
  2182.           Allows the user to choose an item from an unsorted listbox.
  2183.  
  2184.  
  2185.  
  2186.  
  2187.        File Management
  2188.        FileAppend (from-list, to-file)
  2189.           Appends one or more files to another file.
  2190.  
  2191.        FileAttrGet (filename)
  2192.           Returns file attributes.
  2193.  
  2194.        FileAttrSet (file-list, settings)
  2195.           Sets file attributes.
  2196.  
  2197.        FileClose (filehandle)
  2198.           Closes a file.
  2199.  
  2200.        FileCopy (from-list, to-file, warning)
  2201.           Copies files.
  2202.  
  2203.        FileDelete (file-list)
  2204.           Deletes files.
  2205.  
  2206.  
  2207.  
  2208.  
  2209.  
  2210.        FileExist (filename)
  2211.           Determines if a file exists.
  2212.  
  2213.        FileExtension (filename)
  2214.           Returns extension of file.
  2215.  
  2216.        FileItemize (file-list)
  2217.           Builds a list of files.
  2218.  
  2219.        FileLocate (filename)
  2220.           Finds a file within the current DOS path.
  2221.  
  2222.        FileMove (from-list, to-file, warning)
  2223.           Moves files to another set of pathnames.
  2224.  
  2225.        FileOpen (filename, open-type)
  2226.           Opens a STANDARD ASCII (only) file for reading or writing.
  2227.  
  2228.        FilePath (filename)
  2229.           Returns path of file.
  2230.  
  2231.        FileRead (filehandle)
  2232.           Reads data from a file.
  2233.  
  2234.        FileRename (from-list, to-file)
  2235.           Renames files to another set of names.
  2236.  
  2237.        FileRoot (filename)
  2238.           Returns root of file.
  2239.  
  2240.        FileSize (file-list)
  2241.           Adds up the total size of a set of files.
  2242.  
  2243.        FileTimeGet (filename)
  2244.           Returns file date and time.
  2245.  
  2246.        FileTimeTouch (file-list)
  2247.           Sets file(s) to current time.
  2248.  
  2249.        FileWrite (filehandle,output-data)
  2250.           Writes data to a file.
  2251.  
  2252.        IniDelete (section, keyname)
  2253.           Removes a line or section from WIN.INI.
  2254.  
  2255.        IniDeletePvt (section, keyname, filename)
  2256.           Removes a line or section from a private INI file.
  2257.  
  2258.        IniItemize (section)
  2259.           Lists keywords or sections in WIN.INI.
  2260.  
  2261.        IniItemizePvt (section, filename)
  2262.           Lists keywords or sections in a private INI file.
  2263.  
  2264.        IniRead (section, keyname, default)
  2265.           Reads a string from the WIN.INI file.
  2266.  
  2267.  
  2268.  
  2269.  
  2270.  
  2271.        IniReadPvt (section, keyname, default, filename)
  2272.           Reads a string from a private INI file.
  2273.  
  2274.        IniWrite (section, keyname, string)
  2275.           Writes a string to the WIN.INI file.
  2276.  
  2277.        IniWritePvt (section, keyname, data, filename)
  2278.           Writes a string to a private INI file.
  2279.  
  2280.  
  2281.  
  2282.  
  2283.        Directory Management
  2284.        DirChange ([d:]path)
  2285.           Changes the current directory.
  2286.  
  2287.        DirGet ( )
  2288.           Returns the current directory path.
  2289.  
  2290.        DirHome ( )
  2291.           Returns the initial directory path.
  2292.  
  2293.        DirItemize (dir-list)
  2294.           Builds a list of directories.
  2295.  
  2296.        DirMake ([d:]path)
  2297.           Creates a new directory.
  2298.  
  2299.        DirRemove ([d:]path)
  2300.           Removes an existing directory.
  2301.  
  2302.        DirRename ([d:]oldpath, [d:]newpath)
  2303.           Renames a directory.
  2304.  
  2305.        DirWindows (request#)
  2306.           Returns the name of the Windows or Windows System directory.
  2307.  
  2308.  
  2309.  
  2310.  
  2311.        Disk Drive Management
  2312.        DiskFree (drive-list)
  2313.           Returns the amount of free space on a set of drives.
  2314.  
  2315.        DiskScan (request#)
  2316.           Returns list of drives.
  2317.  
  2318.        LogDisk (drive)
  2319.           Changes the logged disk drive.
  2320.  
  2321.  
  2322.  
  2323.  
  2324.        Window Management
  2325.        AppExist (program-name)
  2326.           Tells if an application is running.
  2327.  
  2328.  
  2329.  
  2330.  
  2331.  
  2332.        AppWaitClose (program-name)
  2333.           Suspends WIL program execution until a specified application has
  2334.           been closed.
  2335.  
  2336.        IconArrange ( )
  2337.           Rearranges icons.
  2338.  
  2339.        WinActivate (partial-winname)
  2340.           Makes an application window the active window.
  2341.  
  2342.        WinArrange (style)
  2343.           Arranges all running application windows on the screen.
  2344.  
  2345.        WinClose (partial-winname)
  2346.           Closes an application window.
  2347.  
  2348.        WinCloseNot (partial-winname [, partial-winname...])
  2349.           Closes all application windows except those specified.
  2350.  
  2351.        WinExeName (partial-winname)
  2352.           Returns the name of the executable file which created a specified
  2353.           window.
  2354.  
  2355.        WinExist (partial-winname)
  2356.           Tells if window exists.
  2357.  
  2358.        WinGetActive ( )
  2359.           Gets the title of the active window.
  2360.  
  2361.        WinHide (partial-winname)
  2362.           Hides an application window.
  2363.  
  2364.        WinIconize (partial-winname)
  2365.           Turns an application window into an icon.
  2366.  
  2367.        WinItemize ( )
  2368.           Lists all the main windows currently running.
  2369.  
  2370.        WinName ( )
  2371.           Returns the name of the window calling the WIL Interpreter.
  2372.  
  2373.        WinPlace (x-ul, y-ul, x-br, y-br, partial-winname)
  2374.           Changes the size and position of an application window on the
  2375.           screen.
  2376.  
  2377.        WinPlaceGet (win-type, partial-winname)
  2378.           Returns window coordinates.
  2379.  
  2380.        WinPlaceSet (win-type, partial-winname, position-string)
  2381.           Sets window coordinates.
  2382.  
  2383.        WinPosition (partial-winname)
  2384.           Returns window position.
  2385.  
  2386.        WinShow (partial-winname)
  2387.           Shows a currently-hidden application window.
  2388.  
  2389.  
  2390.  
  2391.  
  2392.  
  2393.        WinState (partial-winname)
  2394.           Returns the current state of a window.
  2395.  
  2396.        WinTitle (partial-winname, new-winname)
  2397.           Changes the title of an application window.
  2398.  
  2399.        WinWaitClose (partial-winname)
  2400.           Waits until an application window is closed.
  2401.  
  2402.        WinZoom (partial-winname)
  2403.           Maximizes an application window to full-screen.
  2404.  
  2405.  
  2406.  
  2407.  
  2408.        Program Management
  2409.        Run (program-name, parameters)
  2410.           Runs a program as a normal window.
  2411.  
  2412.        RunHide (program-name, parameters)
  2413.           Runs a program in a hidden window.
  2414.  
  2415.        RunHideWait (program-name, parameters)
  2416.           Runs a program in a hidden window, and waits for it to close.
  2417.  
  2418.        RunIcon (program-name, parameters)
  2419.           Runs a program as an icon.
  2420.  
  2421.        RunIconWait (program-name, parameters)
  2422.           Runs a program as an icon, and waits for it to close.
  2423.  
  2424.        RunWait (program-name, parameters)
  2425.           Runs a program as a normal window, and waits for it to close.
  2426.  
  2427.        RunZoom (program-name, parameters)
  2428.           Runs a program in a maximized window.
  2429.  
  2430.        RunZoomWait (program-name, parameters)
  2431.           Runs a program in a maximized window, and waits for it to close.
  2432.  
  2433.  
  2434.  
  2435.  
  2436.        String Handling
  2437.        Char2Num (string)
  2438.           Returns the ANSI code of a string's first character.
  2439.  
  2440.        IsNumber (string)
  2441.           Determines if a string represents a valid number.
  2442.  
  2443.        ItemCount (list, delimiter)
  2444.           Returns the number of items in a list.
  2445.  
  2446.        ItemExtract (select, list, delimiter)
  2447.           Returns the selected item from a list.
  2448.  
  2449.  
  2450.  
  2451.  
  2452.  
  2453.        ItemInsert (item, index, list, delimiter)
  2454.           Adds an item to a list.
  2455.  
  2456.        ItemLocate (item, list, delimiter)
  2457.           Returns the position of an item in a list.
  2458.  
  2459.        ItemRemove (index, list, delimiter)
  2460.           Removes an item from a list.
  2461.  
  2462.        ItemSort (list, delimiter)
  2463.           Sorts a list.
  2464.  
  2465.        Num2Char (number)
  2466.           Converts a number to the ANSI character it represents.
  2467.  
  2468.        ParseData (string)
  2469.           Parses the passed string, just like passed parameters are parsed.
  2470.  
  2471.        StrCat (string[, string...])
  2472.           Concatenates strings together.
  2473.  
  2474.        StrCmp (string1, string2)
  2475.           Compares two strings.
  2476.  
  2477.        StrFill (string, string-length)
  2478.           Builds a string from a repeated smaller string.
  2479.  
  2480.        StrFix (base-string, padding-string, length)
  2481.           Pads or truncates a string to a fixed length.
  2482.  
  2483.        StriCmp (string1, string2)
  2484.           Compares two strings, ignoring their case.
  2485.  
  2486.        StrIndex (main-str, sub-str, start, direction)
  2487.           Locates a string within a larger string.
  2488.  
  2489.        StrLen (string)
  2490.           Returns the length of a string
  2491.  
  2492.        StrLower (string)
  2493.           Converts a string to all lower-case characters.
  2494.  
  2495.        StrReplace (string, old, new)
  2496.           Replaces all occurances of a substring with another.
  2497.  
  2498.        StrScan (main-str, delims, start, direction)
  2499.           Finds an occurrence of one or more delimiter characters in a
  2500.           string.
  2501.  
  2502.        StrSub (string, start, length)
  2503.           Returns a substring from within a string.
  2504.  
  2505.        StrTrim (string)
  2506.           Trims leading and trailing blanks from a string.
  2507.  
  2508.        StrUpper (string)
  2509.           Converts a string to all upper-case characters.
  2510.  
  2511.  
  2512.  
  2513.  
  2514.  
  2515.  
  2516.  
  2517.  
  2518.        Arithmetic Functions
  2519.        Abs (number)
  2520.           Returns the absolute value of a number.
  2521.  
  2522.        Average (num [, num...])
  2523.           Returns the average of a list of numbers.
  2524.  
  2525.        Max (num [, num...])
  2526.           Determines the highest number in a list.
  2527.  
  2528.        Min (num [, num...])
  2529.           Determines the lowest number in a list.
  2530.  
  2531.        Random (max)
  2532.           Generates a positive random number.
  2533.  
  2534.  
  2535.  
  2536.  
  2537.        Clipboard Handling
  2538.        ClipAppend (string)
  2539.           Appends a string to the end of the Clipboard.
  2540.  
  2541.        ClipGet ( )
  2542.           Returns the Clipboard contents into a string.
  2543.  
  2544.        ClipPut (string)
  2545.           Replaces the Clipboard contents with a string.
  2546.  
  2547.  
  2548.  
  2549.  
  2550.        Process Control
  2551.        Call (filename, parameters)
  2552.           Calls another WIL batch file as a subroutine.
  2553.  
  2554.        Debug (mode)
  2555.           Turns Debug mode on or off.
  2556.  
  2557.        Delay (seconds)
  2558.           Pauses batch file execution.
  2559.  
  2560.        Drop (var [, var...])
  2561.           Deletes variables to recover their memory.
  2562.  
  2563.        Else statement
  2564.           Continues a previous If statement.
  2565.  
  2566.        EndSession ( )
  2567.           Ends the current Windows session.
  2568.  
  2569.        ErrorMode (mode)
  2570.           Sets what happens in the event of an error.
  2571.  
  2572.  
  2573.  
  2574.  
  2575.  
  2576.        Exclusive (mode)
  2577.           Controls whether or not other Windows program will get any time to
  2578.           execute.
  2579.  
  2580.        Execute statement
  2581.           Directly executes a WIL statement.
  2582.  
  2583.        Exit
  2584.           Unconditionally ends a WIL program.
  2585.  
  2586.        Goto label
  2587.           Changes the flow of control in a batch file.
  2588.  
  2589.        If condition Then statement
  2590.           Conditionally performs a function.
  2591.  
  2592.        IgnoreInput (mode)
  2593.           Turns off hardware input to windows.
  2594.  
  2595.        IsDefined (variable)
  2596.           Determines if a variable is currently defined.
  2597.  
  2598.        IsKeyDown (key-codes)
  2599.           Tells about keys/mouse.
  2600.  
  2601.        LastError ( )
  2602.           Returns the last error encountered.
  2603.  
  2604.        Return
  2605.           Returns from a Call to the calling program.
  2606.  
  2607.        SKDebug (mode)
  2608.           Controls how SendKey works
  2609.  
  2610.        Terminate
  2611.           Conditionally ends a WIL program.
  2612.  
  2613.        Then statement
  2614.           Continues a previous If statement.
  2615.  
  2616.        WaitForKey
  2617.           Waits for a specific key to be pressed.
  2618.  
  2619.        Yield
  2620.           Pauses batch file processing so other applications can process some
  2621.           messages.
  2622.  
  2623.  
  2624.  
  2625.  
  2626.        Miscellaneous Functions
  2627.        IntControl (request#, p1, p2, p3, p4)
  2628.           Internal control functions.
  2629.  
  2630.        SendKey (character-codes)
  2631.           Sends keystrokes to the active application.
  2632.  
  2633.  
  2634.  
  2635.  
  2636.  
  2637.        SnapShot (request#)
  2638.           Takes a snapshot of the screen and pastes it to the clipboard.
  2639.  
  2640.        WallPaper (bmp-name, tile)
  2641.           Changes the Windows wallpaper.
  2642.  
  2643.        WinParmSet (request#, new-value, ini-control)
  2644.           Sets system information.
  2645.  
  2646.  
  2647.  
  2648.  
  2649.        System Information
  2650.        DateTime ( )
  2651.           Returns the current date and time.
  2652.  
  2653.        DOSVersion (level)
  2654.           Returns the version numbers of the current version of DOS.
  2655.  
  2656.        Environment (env-variable)
  2657.           Returns the value of a DOS environment variable.
  2658.  
  2659.        IsLicensed ( )
  2660.           Tells if the calling application is licensed.
  2661.  
  2662.        MouseInfo (request#)
  2663.           Returns assorted mouse information.
  2664.  
  2665.        Version ( )
  2666.           Returns the version of the parent program currently running.
  2667.  
  2668.        VersionDLL ( )
  2669.           Returns the version of the WIL Interpreter currently running.
  2670.  
  2671.        WinConfig ( )
  2672.           Returns WIN3 mode flags.
  2673.  
  2674.        WinMetrics (request#)
  2675.           Returns Windows system information.
  2676.  
  2677.        WinParmGet (request#)
  2678.           Returns system information.
  2679.  
  2680.        WinParmSet (request#, new-value, ini-control)
  2681.           Sets system information.
  2682.  
  2683.        WinResources (request#)
  2684.           Returns information on available memory and resources.
  2685.  
  2686.        WinVersion (level)
  2687.           Returns the version of Windows that is currently running.
  2688.  
  2689.  
  2690.  
  2691.  
  2692.  
  2693.  
  2694.  
  2695.  
  2696.        DDE Functions
  2697.        DDEExecute (channel, command string)
  2698.           Sends commands to a DDE server application.
  2699.  
  2700.        DDEInitiate (app name, topic name)
  2701.           Opens a DDE channel.
  2702.  
  2703.        DDEPoke (channel, item name, item value)
  2704.           Sends data to a DDE server application.
  2705.  
  2706.        DDERequest (channel, item name)
  2707.           Gets data from a DDE server application.
  2708.  
  2709.        DDETerminate (channel)
  2710.           Closes a DDE channel.
  2711.  
  2712.        DDETimeout (value)
  2713.           Sets the DDE timeout value.
  2714.  
  2715.  
  2716.  
  2717.  
  2718.        Network Functions
  2719.        NetAddCon (net-path, password, local-name)
  2720.           Connects network resources to imaginary local disk drives or
  2721.           printer ports.
  2722.  
  2723.        NetAttach (server-name)
  2724.           Attaches to a network file server.
  2725.  
  2726.        NetBrowse (request#)
  2727.           Displays a network dialog box allowing the user to select a network
  2728.           resource.
  2729.  
  2730.        NetCancelCon (name, force)
  2731.           Breaks a network connection.
  2732.  
  2733.        NetDetach (server-name)
  2734.           Detaches from a network file server.
  2735.  
  2736.        NetDialog ( )
  2737.           Brings up the network driver's dialog box.
  2738.  
  2739.        NetGetCaps (request#)
  2740.           Returns information on network capabilities.
  2741.  
  2742.        NetGetCon (local-name)
  2743.           Returns the name of a connected network resource.
  2744.  
  2745.        NetGetUser ( )
  2746.           Returns the name of the user currently logged into the network.
  2747.  
  2748.        NetLogin(server-name, user-name, password)
  2749.           Performs a network login.
  2750.  
  2751.  
  2752.  
  2753.  
  2754.  
  2755.        NetLogout(server-name)
  2756.           Performs a network logout.
  2757.  
  2758.        NetMapRoot(local-name, net-path)
  2759.           Maps a local drive to a network resource.
  2760.  
  2761.        NetMemberGet(server-name, group-name)
  2762.           Determines whether the current user is a member of a specific
  2763.           group.
  2764.  
  2765.        NetMemberSet(server-name, group-name)
  2766.           Sets the current user as a member of a group.
  2767.  
  2768.        NetMsgAll(server-name, message)
  2769.           Broadcasts a message to all users on the network.
  2770.  
  2771.        NetMsgSend(server-name, user-name, message)
  2772.           Sends a message to a specific user on the network.
  2773.  
  2774.  
  2775.  
  2776.  
  2777.        Multimedia Functions
  2778.        PlayMedia (command-string)
  2779.           Controls multimedia devices.
  2780.  
  2781.        PlayMidi (filename, mode)
  2782.           Plays a MID or RMI sound file.
  2783.  
  2784.        PlayWaveForm (filename, mode)
  2785.           Plays a WAV sound file.
  2786.  
  2787.        Sounds (request#)
  2788.           Turns sounds on or off.
  2789.  
  2790.  
  2791.  
  2792.  
  2793.        Menu Management
  2794.        CurrentFile ( )
  2795.           Returns the selected filename.
  2796.  
  2797.        IsMenuChecked (menuname)
  2798.           Determines if a menu item has a checkmark next to it.
  2799.  
  2800.        IsMenuEnabled (menuname)
  2801.           Determines if a menu item has been enabled.
  2802.  
  2803.        MenuChange (menuname, flags)
  2804.           Checks, unchecks, enables, or disables a menu item.
  2805.  
  2806.  
  2807.  
  2808.  
  2809.  
  2810.  
  2811.                                          WIL
  2812.                                       FUNCTION
  2813.                                       REFERENCE
  2814.  
  2815.  
  2816.  
  2817.  
  2818.        Introduction
  2819.        The WIL programming language consists of more than 150 functions and
  2820.        commands, which we describe in detail in this section.
  2821.  
  2822.        We use a shorthand notation to indicate the syntax of the functions.
  2823.  
  2824.        Function names and other actual characters you type are in boldface.
  2825.        Optional parameters are enclosed in square brackets "[ ]".  When a
  2826.        function takes a variable number of parameters, the variable parts
  2827.        will be followed by ellipses ("...").
  2828.  
  2829.        Take, for example, string concatenation:
  2830.  
  2831.        StrCat (string[, string...])
  2832.  
  2833.        This says that the StrCat function takes at least one string
  2834.        parameter.  Optionally, you can specify more strings to concatenate.
  2835.        If you do, you must separate the strings with commas.
  2836.  
  2837.        For each function and command, we show you the Syntax, describe the
  2838.        Parameters (if any), the value it Returns (if any), a description of
  2839.        the function, Example code (shown in Courier type), and related
  2840.        functions you may want to See Also.
  2841.  
  2842.  
  2843.  
  2844.        Items marked [*M] are available only in menu script usages (such as
  2845.        Command Post and File Commander).
  2846.  
  2847.  
  2848.  
  2849.        WIL Interpreter is a generic term which refers both to Command Post
  2850.        and to WIL.
  2851.  
  2852.        WIL program is a generic term which refers both to the script for a
  2853.        menu item and to a standalone batch file.
  2854.  
  2855.  
  2856.  
  2857.        (i) indicates an integer parameter or return value.
  2858.  
  2859.        (s) indicates a string parameter or return value.
  2860.  
  2861.  
  2862.  
  2863.  
  2864.        Abs
  2865.        Returns the absolute value of a number.
  2866.  
  2867.  
  2868.  
  2869.  
  2870.  
  2871.  
  2872.        Syntax:
  2873.         Abs (integer)
  2874.  
  2875.        Parameters:
  2876.         (i) integer  integer whose absolute value is desired.
  2877.  
  2878.        Returns:
  2879.         (i)          absolute value of integer.
  2880.  
  2881.        This function returns the absolute (positive) value of the integer
  2882.        which is passed to it, regardless of whether that integer is positive
  2883.        or negative.
  2884.  
  2885.  
  2886.        Example:
  2887.         dy = Abs(y1 - y2)
  2888.         Message("Years", "There are %dy% years 'twixt %y1% and %y2%")
  2889.  
  2890.  
  2891.        See Also:
  2892.           Average, IsNumber, Max, Min
  2893.  
  2894.  
  2895.  
  2896.  
  2897.        AppExist
  2898.        Tells if an application is running.
  2899.  
  2900.  
  2901.        Syntax:
  2902.         AppExist (program-name)
  2903.  
  2904.        Parameters:
  2905.         (s) program-name   name of a Windows EXE or DLL file.
  2906.  
  2907.        Returns:
  2908.         (i)          @TRUE if the specified application is running;
  2909.                      @FALSE if the specified application is not running.
  2910.  
  2911.        Use this function to determine whether a specific Windows application
  2912.        is currently running.  Unlike WinExist, you can use AppExist without
  2913.        knowing the title of the application's window.
  2914.  
  2915.        "Program-name" is the name of a Windows EXE or DLL file, including the
  2916.        file extension (and, optionally, a full path to the file).
  2917.  
  2918.  
  2919.        Example:
  2920.         If AppExist("clock.exe") == @FALSE Then Run("clock.exe", "")
  2921.  
  2922.  
  2923.        See Also:
  2924.           AppWaitClose, Run, WinExeName, WinExist
  2925.  
  2926.  
  2927.  
  2928.  
  2929.  
  2930.  
  2931.  
  2932.  
  2933.        AppWaitClose
  2934.        Suspends WIL program execution until a specified application has been
  2935.        closed.
  2936.  
  2937.  
  2938.        Syntax:
  2939.         AppWaitClose (program-name)
  2940.  
  2941.        Parameters:
  2942.         (s) program-name   name of a Windows EXE or DLL file.
  2943.  
  2944.        Returns:
  2945.         (i)          @TRUE if the specified application is running;
  2946.                      @FALSE if the specified application is not running.
  2947.  
  2948.        Use this function to suspend the WIL program's execution until the
  2949.        user has finished using a given application and has manually closed
  2950.        it.  Unlike WinWaitClose, you can use AppWaitClose without knowing the
  2951.        title of the application's window.
  2952.  
  2953.        "Program-name" is the name of a Windows EXE or DLL file, including the
  2954.        file extension (and, optionally, a full path to the file).
  2955.  
  2956.  
  2957.        Example:
  2958.         Run("clock.exe", "")
  2959.         Display(4, "Note", "Close Clock to continue")
  2960.         AppWaitClose("clock.exe")
  2961.         Message("Continuing...", "Clock closed")
  2962.  
  2963.  
  2964.        See Also:
  2965.           AppExist, Delay, RunWait, WinExeName, Yield
  2966.  
  2967.  
  2968.  
  2969.  
  2970.        AskLine
  2971.        Prompts the user for one line of input.
  2972.  
  2973.  
  2974.        Syntax:
  2975.         AskLine (title, prompt, default)
  2976.  
  2977.        Parameters:
  2978.         (s) title    title of the dialog box.
  2979.         (s) prompt   question to be put to the user.
  2980.         (s) default  default answer.
  2981.  
  2982.        Returns:
  2983.         (s)          user response.
  2984.  
  2985.        Use this function to query the user for a line of data.  The entire
  2986.        user response will be returned if the user presses the OK button or
  2987.  
  2988.  
  2989.  
  2990.  
  2991.  
  2992.        the Enter key.  If the user presses the Cancel button or the Esc key,
  2993.        the processing of the WIL program is canceled.
  2994.  
  2995.  
  2996.        Example:
  2997.         name = AskLine("Game", "Please enter your name", "")
  2998.         game = AskLine("Game", "Favorite game?", "Solitaire")
  2999.         message(StrCat(name,"'s favorite game is "), game)
  3000.  
  3001.        produces:
  3002.  
  3003.  
  3004.  
  3005.  
  3006.  
  3007.  
  3008.  
  3009.  
  3010.  
  3011.  
  3012.  
  3013.  
  3014.  
  3015.  
  3016.  
  3017.  
  3018.  
  3019.  
  3020.  
  3021.  
  3022.  
  3023.  
  3024.  
  3025.        And then, if Richard types "Scramble" and clicks on the OK button:
  3026.  
  3027.  
  3028.  
  3029.  
  3030.  
  3031.  
  3032.  
  3033.  
  3034.  
  3035.        See Also:
  3036.           AskPassword, AskYesNo, DialogBox, Display, ItemSelect, Message,
  3037.           Pause, TextBox, TextSelect
  3038.  
  3039.  
  3040.  
  3041.  
  3042.        AskPassword
  3043.        Prompts the user for a password.
  3044.  
  3045.  
  3046.        Syntax:
  3047.         AskPassword (title, prompt)
  3048.  
  3049.  
  3050.  
  3051.  
  3052.  
  3053.  
  3054.        Parameters:
  3055.         (s) title    title of the dialog box.
  3056.         (s) prompt   question to be put to the user.
  3057.  
  3058.        Returns:
  3059.         (s)          user response.
  3060.  
  3061.        Pops up a special dialog box to ask for a password.  An asterisk (*)
  3062.        is echoed for each character that the user types; the actual
  3063.        characters entered are not displayed.  The entire user response will
  3064.        be returned if the user presses the OK button or the Enter key.  If
  3065.        the user presses the Cancel button or the Esc key, the processing of
  3066.        the WIL program is canceled.
  3067.  
  3068.  
  3069.        Example:
  3070.         pw = AskPassword("Security check", "Please enter your password")
  3071.         If StriCmp(pw, "winguy") != 0 Then Goto nogo
  3072.         Run(Environment("COMSPEC"), "")
  3073.         Exit
  3074.         :nogo
  3075.         Pause("Security breach", "Invalid password entered")
  3076.  
  3077.  
  3078.        See Also:
  3079.           AskLine, AskYesNo, DialogBox
  3080.  
  3081.  
  3082.  
  3083.  
  3084.        AskYesNo
  3085.        Prompts the user for a Yes or No answer.
  3086.  
  3087.  
  3088.        Syntax:
  3089.         AskYesNo (title, question)
  3090.  
  3091.        Parameters
  3092.         (s) title    title of the question box.
  3093.         (s) question question to be put to the user.
  3094.  
  3095.        Returns:
  3096.         (i)          @YES or @NO, depending on the button pressed.
  3097.  
  3098.        This function displays a message box with three pushbuttons - Yes, No,
  3099.        and Cancel.  If the user presses Cancel, the current WIL program is
  3100.        ended, so there is no return value.
  3101.  
  3102.  
  3103.        Example:
  3104.         q = AskYesNo('Testing', 'Please press "YES"')
  3105.         If q == @YES Then Exit
  3106.         Display(3, 'ERROR', 'I said press "YES"')
  3107.  
  3108.        Produces:
  3109.  
  3110.  
  3111.  
  3112.  
  3113.  
  3114.  
  3115.  
  3116.  
  3117.  
  3118.  
  3119.  
  3120.  
  3121.  
  3122.  
  3123.  
  3124.        And then, if the user presses No:
  3125.  
  3126.  
  3127.  
  3128.  
  3129.  
  3130.  
  3131.  
  3132.        See Also:
  3133.           AskLine, AskPassword, DialogBox, Display, ItemSelect, Message,
  3134.           Pause, TextBox
  3135.  
  3136.  
  3137.  
  3138.  
  3139.        Average
  3140.        Returns the average of a list of numbers.
  3141.  
  3142.  
  3143.        Syntax:
  3144.         Average (integer [, integer...])
  3145.  
  3146.        Parameters:
  3147.         (i) integer  integers to get the average of.
  3148.  
  3149.        Returns:
  3150.         (i)          average of the integers.
  3151.  
  3152.        Use this function to compute the mean average of a series of numbers,
  3153.        delimited by commas.  This function returns an integer value, so there
  3154.        can be some rounding error involved.
  3155.  
  3156.  
  3157.        Example:
  3158.         avg = Average(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)
  3159.         Message("The average is", avg)
  3160.  
  3161.  
  3162.        See Also:
  3163.           Abs, Max, Min, Random
  3164.  
  3165.  
  3166.  
  3167.  
  3168.        Beep
  3169.        Beeps once.
  3170.  
  3171.  
  3172.  
  3173.  
  3174.  
  3175.  
  3176.        Syntax:
  3177.         Beep
  3178.  
  3179.        Parameters:
  3180.         (none)
  3181.  
  3182.        Returns:
  3183.         (not applicable)
  3184.  
  3185.  
  3186.        Use this command to produce a short beep, generally to alert the user
  3187.        to an error situation or to get the user's attention.
  3188.  
  3189.  
  3190.        Example:
  3191.         Beep
  3192.         Pause("WARNING!!!", "You are about to destroy data!")
  3193.  
  3194.  
  3195.        See Also:
  3196.           PlayMedia, PlayMidi, PlayWaveForm, Sounds
  3197.  
  3198.  
  3199.  
  3200.  
  3201.        Call
  3202.        Calls another WIL batch file as a subroutine.
  3203.  
  3204.  
  3205.        Syntax:
  3206.         Call (filename, parameters)
  3207.  
  3208.        Parameters:
  3209.         (s) filename the WIL batch file you are calling (including
  3210.                      extension).
  3211.         (s) parameters     the parameters to pass to the file, if any, in the
  3212.                      form
  3213.                      "p1 p2 p3 ... pn".
  3214.  
  3215.        Returns:
  3216.         (i)          always 0.
  3217.  
  3218.  
  3219.        This function is used to pass control temporarily to a secondary WIL
  3220.        batch file.  The main WIL program can optionally pass parameters to
  3221.        the secondary WIL batch file.  All variables are common (global)
  3222.        between the calling program and the called WIL batch file, so that the
  3223.        secondary WIL batch file may modify or create variables.  The
  3224.        secondary WIL batch file should end with a Return statement, to pass
  3225.        control back to the main WIL program.
  3226.  
  3227.        If a string of parameters is passed to the secondary WIL batch file,
  3228.        it will automatically be parsed into individual variables with the
  3229.        names param1, param2, etc., (maximum of nine parameters).  The
  3230.        variable param0 will be a count of the total number of parameters in
  3231.        the string.
  3232.  
  3233.  
  3234.  
  3235.  
  3236.  
  3237.  
  3238.        Example:
  3239.         ; MAIN.WBT
  3240.         name = AskLine("", "What is your name?", "")
  3241.         age = AskLine("", "How old are you?", "")
  3242.         valid = @NO
  3243.         Call("chek-age.wbt", age)
  3244.         If valid == @NO Then Message("", "Invalid age")
  3245.  
  3246.         ; CHEK-AGE.WBT
  3247.         userage = param1
  3248.         really = AskYesNo("", "%name%, are you really %userage%?")
  3249.         If really == @NO Then Return
  3250.         If (userage > 0) && (userage < 150) Then valid = @YES
  3251.         Return
  3252.  
  3253.  
  3254.        See Also:
  3255.           ParseData, Return
  3256.  
  3257.  
  3258.  
  3259.  
  3260.        Char2Num
  3261.        Converts the first character of a string to its numeric equivalent.
  3262.  
  3263.  
  3264.        Syntax:
  3265.         Char2Num (string)
  3266.  
  3267.        Parameters:
  3268.         (s) string   any text string.  Only the first character will be
  3269.                      converted.
  3270.  
  3271.        Returns:
  3272.         (i)          ANSI character code.
  3273.  
  3274.        This function returns the 8-bit ANSI code corresponding to the first
  3275.        character of the string parameter.
  3276.  
  3277.        Note:  For the commonly-used characters (with codes below 128), ANSI
  3278.        and ASCII characters are identical.
  3279.  
  3280.  
  3281.        Example:
  3282.         ; Show the hex equivalent of entered character
  3283.         inpchar = AskLine("ANSI Equivalents", "Char:", "")
  3284.         ansi = StrSub(inpchar, 1, 1)
  3285.         ansiequiv = Char2Num(InpChar)
  3286.         Message("ANSI Codes", "%ansi% => %ansiequiv%")
  3287.  
  3288.  
  3289.        See Also:
  3290.           IsNumber, Num2Char
  3291.  
  3292.  
  3293.  
  3294.  
  3295.  
  3296.  
  3297.  
  3298.  
  3299.        ClipAppend
  3300.        Appends a string to the Clipboard.
  3301.  
  3302.  
  3303.        Syntax:
  3304.         ClipAppend (string)
  3305.  
  3306.        Parameters:
  3307.         (s) string   text string to add to Clipboard.
  3308.  
  3309.        Returns:
  3310.         (i)          @TRUE if string was appended;
  3311.                      @FALSE if Clipboard ran out of memory.
  3312.  
  3313.        Use this function to append a string to the Windows Clipboard.  The
  3314.        Clipboard must either contain text data or be empty for this function
  3315.        to succeed.
  3316.  
  3317.  
  3318.        Example:
  3319.         ; The code below will append 2 copies of the
  3320.         ; Clipboard contents back to the Clipboard, resulting
  3321.         ; in 3 copies of the original contents with a CR/LF
  3322.         ; between each copy.
  3323.         a = ClipGet()
  3324.         crlf = StrCat(Num2Char(13), Num2Char(10))
  3325.         ClipAppend(crlf)
  3326.         ClipAppend(a)
  3327.         ClipAppend(crlf)
  3328.         ClipAppend(a)
  3329.  
  3330.  
  3331.        See Also:
  3332.           ClipGet, ClipPut
  3333.  
  3334.  
  3335.  
  3336.  
  3337.        ClipGet
  3338.        Returns the contents of the Clipboard.
  3339.  
  3340.  
  3341.        Syntax:
  3342.         ClipGet ( )
  3343.  
  3344.        Parameters:
  3345.         (none)
  3346.  
  3347.        Returns:
  3348.         (s)          Clipboard contents.
  3349.  
  3350.        Use this function to copy text from the Windows Clipboard into a
  3351.        string variable.
  3352.  
  3353.  
  3354.  
  3355.  
  3356.  
  3357.        Note:  If the Clipboard contains an excessively large string a (fatal)
  3358.        out of memory error may occur.
  3359.  
  3360.  
  3361.        Example:
  3362.         ; The code below will convert Clipboard contents to
  3363.         ; uppercase
  3364.         ClipPut(StrUpper(ClipGet()))
  3365.         a = ClipGet()
  3366.         Message("UPPERCASE Clipboard Contents", a)
  3367.  
  3368.  
  3369.        See Also:
  3370.           ClipAppend, ClipPut
  3371.  
  3372.  
  3373.  
  3374.  
  3375.        ClipPut
  3376.        Copies a string to the Clipboard.
  3377.  
  3378.  
  3379.        Syntax:
  3380.         ClipPut (string)
  3381.  
  3382.        Parameters:
  3383.         (s) string   any text string.
  3384.  
  3385.        Returns:
  3386.         (i)          @TRUE if string was copied;
  3387.                      @FALSE if Clipboard ran out of memory.
  3388.  
  3389.        Use this function to copy a string to the Windows Clipboard.  The
  3390.        previous Clipboard contents will be lost.
  3391.  
  3392.  
  3393.        Example:
  3394.         ; The code below will convert Clipboard contents to
  3395.         ; lowercase
  3396.         ClipPut(StrLower(ClipGet()))
  3397.         a = ClipGet()
  3398.         Message("lowercase Clipboard Contents", a)
  3399.  
  3400.  
  3401.        See Also:
  3402.           ClipAppend, ClipGet, SnapShot
  3403.  
  3404.  
  3405.  
  3406.  
  3407.        CurrentFile [*M]
  3408.        Returns the selected filename.
  3409.  
  3410.  
  3411.        Syntax:
  3412.         CurrentFile ( )
  3413.  
  3414.  
  3415.  
  3416.  
  3417.  
  3418.  
  3419.        Parameters:
  3420.         (none)
  3421.  
  3422.        Returns:
  3423.         (s)          currently-selected file's name.
  3424.  
  3425.        When the WIL menu shell displays the files in the current directory,
  3426.        one of them may be "selected."  This function returns the name of that
  3427.        file, if any.
  3428.  
  3429.        This is different than a "highlighted" file.  When a file is
  3430.        highlighted, it shows up in inverse video (usually white-on-black).
  3431.        To find the filenames that are highlighted, see FileItemize.
  3432.  
  3433.        Note: This command is not part of the WIL Interpreter package, but is
  3434.        documented here because it has been implemented in many of the shell
  3435.        or file manager-type applications which use the WIL Interpreter.
  3436.  
  3437.  
  3438.        Example:
  3439.         ; ask which program to run (default = current file)
  3440.         thefile = AskLine("Run It", "Program:", CurrentFile())
  3441.         Run(thefile, "")
  3442.  
  3443.  
  3444.        See Also:
  3445.           DirGet, DirItemize, FileItemize
  3446.  
  3447.  
  3448.  
  3449.  
  3450.        DateTime
  3451.        Provides the current date and time.
  3452.  
  3453.  
  3454.        Syntax:
  3455.         DateTime ( )
  3456.  
  3457.        Parameters:
  3458.         (none)
  3459.  
  3460.        Returns:
  3461.         (s)          today's date and time
  3462.  
  3463.        This function will return the current date and time in a pre-formatted
  3464.        string.  The format it is returned in depends on how it is set up in
  3465.        the [Intl] section of the WIN.INI file:
  3466.  
  3467.        ddd mm/dd/yy hh:mm:ss XX
  3468.        ddd dd/mm/yy hh:mm:ss XX
  3469.        ddd yy/mm/dd hh:mm:ss XX
  3470.  
  3471.        Where:
  3472.           ddd is day of the week (e.g. Mon)
  3473.           mm  is the month (e.g. 10)
  3474.           dd  is the day of the month (e.g. 23)
  3475.  
  3476.  
  3477.  
  3478.  
  3479.  
  3480.           yy  is the year (e.g. 90)
  3481.           hh  is the hours
  3482.           mm  is the minutes
  3483.           ss  is the seconds
  3484.           XX  is the Day/Night code (e.g. AM or PM)
  3485.  
  3486.        Note:  Windows provides even more formatting options than this.
  3487.  
  3488.        The WIN.INI file will be examined to determine which format to use.
  3489.        You can adjust the WIN.INI file via the [Intl] section of Control
  3490.        Panel if the format isn't what you prefer.
  3491.  
  3492.  
  3493.        Example:
  3494.         ; assuming the current standard is U.S.
  3495.         ; (i.e. day  dd/mm/yy hh:mm:ss AM)
  3496.         Message("Current Date & Time", DateTime())
  3497.  
  3498.        would produce:
  3499.  
  3500.  
  3501.  
  3502.  
  3503.  
  3504.  
  3505.  
  3506.  
  3507.  
  3508.        See Also:
  3509.           FileTimeGet
  3510.  
  3511.  
  3512.  
  3513.  
  3514.        DDEExecute
  3515.        Sends commands to a DDE server application.
  3516.  
  3517.  
  3518.        Syntax:
  3519.         DDEExecute (channel, command string)
  3520.  
  3521.        Parameters:
  3522.         (i) channel  same integer that was returned by DDEInitiate.
  3523.         (s) command string one or more commands to be executed by the server
  3524.                      app.
  3525.  
  3526.        Returns:
  3527.         (i)          @TRUE if successful; @FALSE if unsuccessful.
  3528.  
  3529.        Use the DDEInitiate function to obtain a channel number.
  3530.  
  3531.        In order to use this function successfully, you will need appropriate
  3532.        documentation for the server application you wish to access, which
  3533.        must provide information on the DDE functions that it supports and the
  3534.        correct syntax to use.
  3535.  
  3536.  
  3537.  
  3538.  
  3539.  
  3540.  
  3541.        Example:
  3542.         Run("wincheck.exe", "TUT")
  3543.         channel = DDEInitiate("wincheck", "TUT")
  3544.         If channel == 0 Then Goto failed
  3545.         result = DDEExecute(channel, '[WriteCheck:p="Shorewood 
  3546.             Apartments",t=580.00,l="Rent"]')
  3547.         DDETerminate(channel)
  3548.         WinClose("WinCheck")
  3549.         If result == @FALSE Then Goto Failed
  3550.         Message("DDE Execute", "Operation complete")
  3551.         Exit
  3552.         :failed
  3553.         Message("DDE operation unsuccessful", "Check your syntax")
  3554.  
  3555.  
  3556.        See Also:
  3557.           DDEInitiate, DDEPoke, DDERequest, DDETerminate, DDETimeout
  3558.  
  3559.  
  3560.  
  3561.  
  3562.        DDEInitiate
  3563.        Opens a DDE channel.
  3564.  
  3565.  
  3566.        Syntax:
  3567.         DDEInitiate (app name, topic name)
  3568.  
  3569.        Parameters:
  3570.         (s) app name name of the application (without the EXE extension).
  3571.         (s) topic name     name of the topic you wish to access.
  3572.  
  3573.        Returns:
  3574.         (i)          communications channel.
  3575.  
  3576.        This function opens a DDE communications channel with a server
  3577.        application.  The communications channel can be subsequently used by
  3578.        the DDEExecute, DDEPoke, and DDERequest functions.  You should close
  3579.        this channel with DDETerminate when you are finished using it.  If the
  3580.        communications channel cannot be opened as requested, DDEInitiate
  3581.        returns a channel number of 0.
  3582.  
  3583.        You can call DDEInitiate more than once, in order to carry on multiple
  3584.        DDE conversations (with multiple applications) simultaneously.
  3585.  
  3586.        In order to use this function successfully, you will need appropriate
  3587.        documentation for the server application you wish to access, which
  3588.        must provide information on the DDE functions that it supports and the
  3589.        correct syntax to use.
  3590.  
  3591.  
  3592.  
  3593.  
  3594.  
  3595.  
  3596.        Example:
  3597.         Run("wincheck.exe", "TUT")
  3598.         channel = DDEInitiate("WinCheck", "TUT")
  3599.         If channel == 0 Then Goto failed
  3600.         output = DDERequest(channel, "GetChecking")
  3601.         DDETerminate(channel)
  3602.         WinClose("WinCheck")
  3603.         If output == "" Then Goto Failed
  3604.         Message("Account balance", output)
  3605.         Exit
  3606.         :failed
  3607.         Message("DDE operation unsuccessful", "Check your syntax")
  3608.  
  3609.  
  3610.        See Also:
  3611.           DDEExecute, DDEPoke, DDERequest, DDETerminate, DDETimeout
  3612.  
  3613.  
  3614.  
  3615.  
  3616.        DDEPoke
  3617.        Sends data to a DDE server application.
  3618.  
  3619.  
  3620.        Syntax:
  3621.         DDEPoke (channel, item name, item value)
  3622.  
  3623.        Parameters:
  3624.         (i) channel  same integer that was returned by DDEInitiate.
  3625.         (s) item name identifies the type of data being sent.
  3626.         (s) item value     actual data to be sent to the server.
  3627.  
  3628.        Returns:
  3629.         (i)          @TRUE if successful; @FALSE if unsuccessful.
  3630.  
  3631.        Use the DDEInitiate function to obtain a channel number.
  3632.  
  3633.        In order to use this function successfully, you will need appropriate
  3634.        documentation for the server application you wish to access, which
  3635.        must provide information on the DDE functions that it supports and the
  3636.        correct syntax to use.
  3637.  
  3638.  
  3639.        Example:
  3640.         Run("reminder.exe", "")
  3641.         channel = DDEInitiate("Reminder", "items")
  3642.         If channel == 0 Then Goto failed
  3643.         result = DDEPoke(channel, "all", "11/3/92 Misc Remember to vote")
  3644.         DDETerminate(channel)
  3645.         WinClose("Reminder")
  3646.         If result == @FALSE Then Goto Failed
  3647.         Message("DDE Poke", "Operation complete")
  3648.         Exit
  3649.         :failed
  3650.         Message("DDE operation unsuccessful", "Check your syntax")
  3651.  
  3652.  
  3653.  
  3654.  
  3655.  
  3656.  
  3657.        See Also:
  3658.           DDEExecute, DDEInitiate, DDERequest, DDETerminate, DDETimeout
  3659.  
  3660.  
  3661.  
  3662.  
  3663.        DDERequest
  3664.        Gets data from a DDE server application.
  3665.  
  3666.  
  3667.        Syntax:
  3668.         DDERequest (channel, item name)
  3669.  
  3670.        Parameters:
  3671.         (i) channel  same integer that was returned by DDEInitiate.
  3672.         (s) item name identifies the data to be returned by the server.
  3673.  
  3674.        Returns:
  3675.         (s)          information returned from the server.
  3676.  
  3677.        Use the DDEInitiate function to obtain a channel number.
  3678.  
  3679.        In order to use this function successfully, you will need appropriate
  3680.        documentation for the server application you wish to access, which
  3681.        must provide information on the DDE functions that it supports and the
  3682.        correct syntax to use.
  3683.  
  3684.  
  3685.        Example:
  3686.         Run("wincheck.exe", "TUT")
  3687.         channel = DDEInitiate("WinCheck", "TUT")
  3688.         If channel == 0 Then Goto failed
  3689.         output = DDERequest(channel, "GetChecking")
  3690.         DDETerminate(channel)
  3691.         WinClose("WinCheck")
  3692.         If output == "" Then Goto Failed
  3693.         Message("Account balance", output)
  3694.         Exit
  3695.         :failed
  3696.         Message("DDE operation unsuccessful", "Check your syntax")
  3697.  
  3698.  
  3699.        See Also:
  3700.           DDEExecute, DDEInitiate, DDEPoke, DDETerminate, DDETimeout
  3701.  
  3702.  
  3703.  
  3704.  
  3705.        DDETerminate
  3706.        Closes a DDE channel.
  3707.  
  3708.  
  3709.        Syntax:
  3710.         DDETerminate (channel)
  3711.  
  3712.  
  3713.  
  3714.  
  3715.  
  3716.  
  3717.        Parameters:
  3718.         (i) channel  same integer that was returned by DDEInitiate.
  3719.  
  3720.        Returns:
  3721.         (i)          always 1.
  3722.  
  3723.        This function closes a communications channel that was opened with
  3724.        DDEInitiate.
  3725.  
  3726.        Example:
  3727.         Run("wincheck.exe", "TUT")
  3728.         channel = DDEInitiate("WinCheck", "TUT")
  3729.         If channel == 0 Then Goto failed
  3730.         output = DDERequest(channel, "GetChecking")
  3731.         DDETerminate(channel)
  3732.         WinClose("WinCheck")
  3733.         If output == "" Then Goto Failed
  3734.         Message("Account balance", output)
  3735.         Exit
  3736.         :failed
  3737.         Message("DDE operation unsuccessful", "Check your syntax")
  3738.  
  3739.  
  3740.        See Also:
  3741.           DDEExecute, DDEInitiate, DDEPoke, DDERequest, DDETimeout
  3742.  
  3743.  
  3744.  
  3745.  
  3746.        DDETimeout
  3747.        Sets the DDE timeout value.
  3748.  
  3749.  
  3750.        Syntax:
  3751.         DDETimeout (value)
  3752.  
  3753.        Parameters:
  3754.         (i) value    DDE timeout time.
  3755.  
  3756.        Returns:
  3757.         (i)          previous timeout value.
  3758.  
  3759.        Sets the timeout time for subsequent DDE functions to specified value
  3760.        in milliseconds (1/1000 second).  Default is 3000 milliseconds (3
  3761.        seconds).  If the time elapses with no response, the WIL Interpreter
  3762.        will return an error.  The value set with DDETimeout stays in effect
  3763.        until changed by another DDETimeout statement or until the WIL program
  3764.        ends, whichever comes first.
  3765.  
  3766.  
  3767.  
  3768.  
  3769.  
  3770.  
  3771.        Example:
  3772.         DDETimeout(5000)
  3773.         Run("wincheck.exe", "TUT")
  3774.         channel = DDEInitiate("WinCheck", "TUT")
  3775.         If channel == 0 Then Goto failed
  3776.         output = DDERequest(channel, "GetChecking")
  3777.         DDETerminate(channel)
  3778.         WinClose("WinCheck")
  3779.         If output == "" Then Goto Failed
  3780.         Message("Account balance", output)
  3781.         Exit
  3782.         :failed
  3783.         Message("DDE operation unsuccessful", "Check your syntax")
  3784.  
  3785.  
  3786.        See Also:
  3787.           DDEExecute, DDEInitiate, DDEPoke, DDERequest, DDETerminate
  3788.  
  3789.  
  3790.  
  3791.  
  3792.        Debug
  3793.        Controls the debug mode.
  3794.  
  3795.  
  3796.        Syntax:
  3797.         Debug (mode)
  3798.  
  3799.        Parameters:
  3800.         (i) mode     @ON or @OFF
  3801.  
  3802.        Returns:
  3803.         (i)          previous debug mode
  3804.  
  3805.        Use this function to turn the debug mode on or off.  The default is
  3806.        @OFF.
  3807.  
  3808.        When debug mode is on, the WIL Interpreter will display the statement
  3809.        just executed, its result (if any), any error conditions, and the next
  3810.        statement to execute.
  3811.  
  3812.        The statements are displayed in a special dialog box which gives the
  3813.        user four options:  Next, Run, Cancel and Show Var.
  3814.  
  3815.        Next executes the next statement and remains in debug mode.
  3816.  
  3817.        Run exits debug mode and runs the rest of the program normally.
  3818.  
  3819.        Cancel terminates the current WIL program.
  3820.  
  3821.        Show Var displays the contents of a variable whose name the user
  3822.        entered in the edit box.
  3823.  
  3824.  
  3825.  
  3826.  
  3827.  
  3828.  
  3829.        Example:
  3830.         Debug(@ON)
  3831.         a = 6
  3832.         q = AskYesNo("Testing Debug Mode", "Is the Pope Catholic")
  3833.         Debug(@OFF)
  3834.         b = a + 4
  3835.  
  3836.        produces:
  3837.  
  3838.  
  3839.  
  3840.  
  3841.  
  3842.  
  3843.  
  3844.  
  3845.  
  3846.  
  3847.  
  3848.  
  3849.  
  3850.  
  3851.        ... then, if the user presses Next:
  3852.  
  3853.  
  3854.  
  3855.  
  3856.  
  3857.  
  3858.  
  3859.  
  3860.  
  3861.  
  3862.  
  3863.  
  3864.  
  3865.  
  3866.        ... and presses Next again:
  3867.  
  3868.  
  3869.  
  3870.  
  3871.  
  3872.  
  3873.  
  3874.  
  3875.  
  3876.  
  3877.  
  3878.        ... and then presses Yes:
  3879.  
  3880.  
  3881.  
  3882.  
  3883.  
  3884.  
  3885.  
  3886.  
  3887.  
  3888.  
  3889.  
  3890.  
  3891.  
  3892.  
  3893.  
  3894.  
  3895.  
  3896.  
  3897.        etc.  (If the user had pressed No it would have said "VALUE=>0".)
  3898.  
  3899.  
  3900.        See Also:
  3901.           ErrorMode, LastError, SKDebug
  3902.  
  3903.  
  3904.  
  3905.  
  3906.        Delay
  3907.        Pauses execution for a specified amount of time.
  3908.  
  3909.  
  3910.        Syntax:
  3911.         Delay (seconds)
  3912.  
  3913.        Parameters:
  3914.         (i) seconds  integer seconds to delay (2 - 3600)
  3915.  
  3916.        Returns:
  3917.         (i)          always 1
  3918.  
  3919.        This function causes the currently-executing WIL program to be
  3920.        suspended for the specified period of time.  Seconds must be an
  3921.        integer between 2 and 3600.  Smaller or larger numbers will be
  3922.        adjusted accordingly.
  3923.  
  3924.  
  3925.        Example:
  3926.         Message("Wait", "About 15 seconds")
  3927.         Delay(15)
  3928.         Message("Hi", "I'm Baaaaaaack")
  3929.  
  3930.  
  3931.        See Also:
  3932.           Yield
  3933.  
  3934.  
  3935.  
  3936.  
  3937.        DialogBox
  3938.        Pops up a Windows dialog box defined by the WDG template file.
  3939.  
  3940.  
  3941.  
  3942.  
  3943.  
  3944.  
  3945.        Syntax:
  3946.         DialogBox (title, WDG-file)
  3947.  
  3948.        Parameters:
  3949.         (s) title    the title of the dialog box.
  3950.         (s) WDG-file the name of the WDG template file.
  3951.  
  3952.        Returns:
  3953.         (i)          always 0.
  3954.  
  3955.        Each element in the template file is enclosed in square brackets, and
  3956.        consists of a variable name, followed by one of the following symbols:
  3957.  
  3958.           Symbol Meaning           Example
  3959.  
  3960.             +    check box         [backup+1Save backup]
  3961.             #    edit box          [newfile#   ]
  3962.             \    file selection listbox        [editfile\     ]
  3963.             ^    radio button      [prog^1Note]     [prog^2Write]
  3964.             $    variable          [var$]
  3965.  
  3966.        The number following the check box and radio button symbols is the
  3967.        value which will get assigned to the variable if its corresponding box
  3968.        is checked, or button is selected.  Following the number is the
  3969.        descriptive text which will appear next to the box or button.
  3970.  
  3971.        When used in conjunction with a file selection list box variable with
  3972.        the same name, two of these symbols have special meanings:
  3973.  
  3974.             #    file mask edit box            [editfile#     ]
  3975.             $    directory variable            [editfile$     ]
  3976.  
  3977.        Anything not appearing within square brackets is displayed as text.
  3978.  
  3979.        See the separate manual section on Dialog Boxes (pg. 185) for more
  3980.        detailed information on using this function.
  3981.  
  3982.  
  3983.        Example:
  3984.         DialogBox("Edit a file", "edit.wdg")
  3985.         If backup == 0 Then Goto nobackup
  3986.         filebackupname = StrCat(FileRoot(editfile), ".", "bak")
  3987.         FileCopy(editfile, filebackupname, @TRUE)
  3988.         :nobackup
  3989.         If prog == 1 Then Run("notepad.exe", editfile)
  3990.         If prog == 2 Then Run("c:\win\apps\winedit.exe", editfile)
  3991.  
  3992.        Here is the template file, EDIT.WDG:
  3993.  
  3994.  
  3995.  
  3996.  
  3997.  
  3998.         [editfile$       ]
  3999.              File mask [editfile#    ]
  4000.         [editfile\                      ]
  4001.         [editfile\                      ]
  4002.         [editfile\                      ]
  4003.         [editfile\                      ]
  4004.         [editfile\                      ]
  4005.         [backup+1Save backup of file]
  4006.         [prog^1Notepad]     [prog^2WinEdit]
  4007.  
  4008.  
  4009.        See Also:
  4010.           AskLine, AskPassword, AskYesNo, ItemSelect
  4011.  
  4012.  
  4013.  
  4014.  
  4015.        DirChange
  4016.        Changes the current directory.  Can also log a new drive.
  4017.  
  4018.  
  4019.        Syntax:
  4020.         DirChange ([d:]path)
  4021.  
  4022.        Parameters:
  4023.         (s) [d:]     an optional disk drive to log onto.
  4024.         (s) path     the desired path.
  4025.  
  4026.        Returns:
  4027.         (i)          @TRUE if directory was changed;
  4028.                      @FALSE if the path could not be found.
  4029.  
  4030.        Use this function to change the current working directory to another
  4031.        directory, either on the same or a different disk drive.
  4032.  
  4033.  
  4034.        Example:
  4035.         DirChange("c:\")
  4036.         TextBox("This is your CONFIG.SYS file", "config.sys")
  4037.  
  4038.  
  4039.        See Also:
  4040.           DirGet, DirHome, LogDisk
  4041.  
  4042.  
  4043.  
  4044.  
  4045.        DirGet
  4046.        Gets the current working directory.
  4047.  
  4048.  
  4049.        Syntax:
  4050.         DirGet ( )
  4051.  
  4052.        Parameters:
  4053.         (none)
  4054.  
  4055.  
  4056.  
  4057.  
  4058.  
  4059.  
  4060.        Returns:
  4061.         (s)          current working directory.
  4062.  
  4063.        Use this function to determine which directory we are currently in.
  4064.        It's especially useful when changing drives or directories
  4065.        temporarily.
  4066.  
  4067.  
  4068.        Example:
  4069.         ; Get, then restore current working directory
  4070.         origdir = DirGet()
  4071.         DirChange("c:\")
  4072.         FileCopy("config.sys", "%origdir%xxxtemp.xyz", @FALSE)
  4073.         DirChange(origdir)
  4074.  
  4075.  
  4076.        See Also:
  4077.           CurrentFile, DirHome, DirWindows
  4078.  
  4079.  
  4080.  
  4081.  
  4082.        DirHome
  4083.        Returns directory containing the WIL Interpreter's executable files.
  4084.  
  4085.  
  4086.        Syntax:
  4087.         DirHome ( )
  4088.  
  4089.        Parameters:
  4090.         (none)
  4091.  
  4092.        Returns:
  4093.         (s)          pathname of the home directory.
  4094.  
  4095.        Use this function to determine the directory where the current WIL
  4096.        Interpreter's executable files are stored.
  4097.  
  4098.  
  4099.        Example:
  4100.         a = DirHome()
  4101.         Message("WIL Executable is in ", a)
  4102.  
  4103.  
  4104.        See Also:
  4105.           DirGet, DirWindows
  4106.  
  4107.  
  4108.  
  4109.  
  4110.        DirItemize
  4111.        Returns a space-delimited list of directories.
  4112.  
  4113.  
  4114.        Syntax:
  4115.         DirItemize (dir-list)
  4116.  
  4117.  
  4118.  
  4119.  
  4120.  
  4121.  
  4122.        Parameters:
  4123.         (s) dir-list a string containing a set of subdirectory names, which
  4124.                      may be wildcarded.
  4125.  
  4126.        Returns:
  4127.         (s)          list of directories.
  4128.  
  4129.        This function compiles a list of subdirectories and separates the
  4130.        names with spaces.
  4131.  
  4132.        This is especially useful in conjunction with the ItemSelect function,
  4133.        which enables the user to choose an item from such a space-delimited
  4134.        list.
  4135.  
  4136.        DirItemize("*.*") returns all subdirectories under the current
  4137.        directory.
  4138.  
  4139.        Note: Some shell or file manager applications using the WIL
  4140.        Interpreter allow an empty string ("") to be used as the "dir-list"
  4141.        parameter, in which case all subdirectories highlighted in the file
  4142.        display are returned.  However, if there are any directory names or
  4143.        wildcards in the string, all subdirectories matching the pathnames are
  4144.        returned, regardless of which ones are highlighted.
  4145.  
  4146.  
  4147.        Example:
  4148.         a = DirItemize("*.*")
  4149.         ItemSelect("Directories", a, " ")
  4150.  
  4151.  
  4152.        See Also:
  4153.           CurrentFile, FileItemize, ItemSelect, TextSelect, WinItemize
  4154.  
  4155.  
  4156.  
  4157.  
  4158.        DirMake
  4159.        Creates a new directory.
  4160.  
  4161.  
  4162.        Syntax:
  4163.         DirMake ([d:]path)
  4164.  
  4165.        Parameters:
  4166.         (s) [d:]     the desired disk drive.
  4167.         (s) path     the path to create.
  4168.  
  4169.        Returns:
  4170.         (i)          @TRUE if the directory was successfully created;
  4171.                      @FALSE if it wasn't.
  4172.  
  4173.        Use this function to create a new directory.
  4174.  
  4175.  
  4176.        Example:
  4177.         DirMake("c:\xxxstuff")
  4178.  
  4179.  
  4180.  
  4181.  
  4182.  
  4183.  
  4184.  
  4185.        See Also:
  4186.           DirRemove, DirRename
  4187.  
  4188.  
  4189.  
  4190.  
  4191.        DirRemove
  4192.        Removes a directory.
  4193.  
  4194.  
  4195.        Syntax:
  4196.         DirRemove (dir-list)
  4197.  
  4198.        Parameters:
  4199.         (s) dir-list a space-delimited list of directory pathnames.
  4200.  
  4201.        Returns:
  4202.         (i)          @TRUE if the directory was successfully removed;
  4203.                      @FALSE if it wasn't.
  4204.  
  4205.        Use this function to delete directories.  You can delete one or more
  4206.        at a time by separating directory names with spaces.  You cannot,
  4207.        however, use wildcards.
  4208.  
  4209.  
  4210.        Examples:
  4211.         DirRemove("c:\xxxstuff")
  4212.  
  4213.         DirRemove("tempdir1 tempdir2 tempdir3")
  4214.  
  4215.  
  4216.        See Also:
  4217.           DirMake, DirRename
  4218.  
  4219.  
  4220.  
  4221.  
  4222.        DirRename
  4223.        Renames a directory.
  4224.  
  4225.  
  4226.        Syntax:
  4227.         DirRename ([d:]oldpath, [d:]newpath)
  4228.  
  4229.        Parameters:
  4230.         (s) oldpath  existing directory name, with optional drive.
  4231.         (s) newpath  new name for directory.
  4232.  
  4233.        Returns:
  4234.         (i)          @TRUE if the directory was successfully renamed;
  4235.                      @FALSE if it wasn't.
  4236.  
  4237.  
  4238.        Example:
  4239.         DirRename("c:\temp", "c:\work")
  4240.  
  4241.  
  4242.  
  4243.  
  4244.  
  4245.  
  4246.  
  4247.        See Also:
  4248.           DirMake, DirRemove
  4249.  
  4250.  
  4251.  
  4252.  
  4253.        DirWindows
  4254.        Returns the name of the Windows or Windows System directory.
  4255.  
  4256.  
  4257.        Syntax:
  4258.         DirWindows (request#)
  4259.  
  4260.        Parameters:
  4261.         (i) request# see below.
  4262.  
  4263.  
  4264.        Returns:
  4265.         (s)          directory name.
  4266.  
  4267.        This function returns the name of either the Windows directory or the
  4268.        Windows System directory, depending on the request# specified.
  4269.  
  4270.           Req#   Return value
  4271.  
  4272.           0      Windows directory
  4273.           1      Windows System directory
  4274.  
  4275.  
  4276.        Example:
  4277.         DirChange(DirWindows(0))
  4278.         ini = ItemSelect("Select file to edit", FileItemize("*.ini"), " ")
  4279.         Run("notepad.exe", ini)
  4280.  
  4281.  
  4282.        See Also:
  4283.           DirGet, DirHome
  4284.  
  4285.  
  4286.  
  4287.  
  4288.        DiskFree
  4289.        Finds the total space available on a group of drives.
  4290.  
  4291.  
  4292.        Syntax:
  4293.         DiskFree (drive-list)
  4294.  
  4295.        Parameters:
  4296.         (s) drive-list     one or more drive letters, separated by spaces.
  4297.  
  4298.        Returns:
  4299.         (i)          the number of bytes available on all the specified
  4300.                      drives.
  4301.  
  4302.  
  4303.  
  4304.  
  4305.  
  4306.        This function takes a string consisting of drive letters, separated by
  4307.        spaces.  Only the first character of each non-blank group of
  4308.        characters is used to determine the drives, so you can use just the
  4309.        drive letters, or add a colon (:), or add a backslash (\), or even a
  4310.        whole pathname, and still get a perfectly valid result.
  4311.  
  4312.  
  4313.        Example:
  4314.         size = DiskFree("c d")
  4315.         Message("Space Available on C: and D:", size)
  4316.  
  4317.  
  4318.        See Also:
  4319.           DiskScan, FileSize
  4320.  
  4321.  
  4322.  
  4323.  
  4324.        DiskScan
  4325.        Returns list of drives.
  4326.  
  4327.  
  4328.        Syntax:
  4329.         DiskScan (request#)
  4330.  
  4331.        Parameters:
  4332.         (i) request# see below.
  4333.  
  4334.        Returns:
  4335.         (s)          drive list.
  4336.  
  4337.        Scans disk drives on the system, and returns a space-delimited list of
  4338.        drives of the type specified by request#, in the form "A: B: C: D: ".
  4339.  
  4340.        The request# is a bitmask, so adding the values together (except for
  4341.        0) returns all drive types specified; eg., a request# of 3 returns
  4342.        floppy plus local hard drives.
  4343.  
  4344.           Req#   Return value
  4345.  
  4346.           0      List of unused disk IDs
  4347.           1      List of removable (floppy) drives
  4348.           2      List of local fixed (hard) drives
  4349.           4      List of remote (network) drives
  4350.  
  4351.  
  4352.        Example:
  4353.         hd = DiskScan(2)
  4354.         Message("Hard drives on system", hd)
  4355.  
  4356.  
  4357.        See Also:
  4358.           DiskFree, LogDisk
  4359.  
  4360.  
  4361.  
  4362.  
  4363.  
  4364.  
  4365.  
  4366.  
  4367.        Display
  4368.        Displays a message to the user for a specified period of time.
  4369.  
  4370.  
  4371.        Syntax:
  4372.         Display (seconds, title, text)
  4373.  
  4374.        Parameters:
  4375.         (i) seconds  seconds to display the message (1-3600).
  4376.         (s) title    title of the window to be displayed.
  4377.         (s) text     text of the window to be displayed.
  4378.  
  4379.        Returns:
  4380.         (i)          always 1.
  4381.  
  4382.        Use this function to display a message for a few seconds, and then
  4383.        continue processing without user input.
  4384.  
  4385.        Seconds must be an integer between 1 and 3600.  Smaller or larger
  4386.        numbers will be adjusted accordingly.
  4387.  
  4388.        The display box may be prematurely canceled by the user by clicking a
  4389.        mouse button, or hitting any key.
  4390.  
  4391.  
  4392.        Example:
  4393.         Display(3, "Current window is", WinGetActive())
  4394.  
  4395.        which produces something like this:
  4396.  
  4397.  
  4398.  
  4399.  
  4400.  
  4401.  
  4402.  
  4403.        See Also:
  4404.           Message, Pause
  4405.  
  4406.  
  4407.  
  4408.  
  4409.        DOSVersion
  4410.        Returns the version numbers of the current version of DOS.
  4411.  
  4412.  
  4413.        Syntax:
  4414.         DOSVersion (level)
  4415.  
  4416.        Parameters:
  4417.         (i) level    @MAJOR or @MINOR.
  4418.  
  4419.        Returns:
  4420.         (i)          integer or decimal part of DOS version number.
  4421.  
  4422.  
  4423.  
  4424.  
  4425.  
  4426.  
  4427.        @MAJOR returns the integer part (to the left of the decimal).
  4428.        @MINOR returns the decimal part (to the right of the decimal).
  4429.  
  4430.        If the version of DOS in use is 5.0, then:
  4431.  
  4432.           DOSVersion(@MAJOR)    ==   5
  4433.           DOSVersion(@MINOR)    ==   0
  4434.  
  4435.  
  4436.        Example:
  4437.         i = DOSVersion(@MAJOR)
  4438.         d = DOSVersion(@MINOR)
  4439.         If StrLen(d) == 1 Then d = StrCat("0", d)
  4440.         Message("DOS Version", "%i%.%d%")
  4441.  
  4442.  
  4443.        See Also:
  4444.           Environment, Version, WinVersion
  4445.  
  4446.  
  4447.  
  4448.  
  4449.        Drop
  4450.        Removes variables from memory.
  4451.  
  4452.  
  4453.        Syntax:
  4454.         Drop (var, [var...])
  4455.  
  4456.        Parameters:
  4457.         (i) var      variable names to remove.
  4458.  
  4459.        Returns:
  4460.         (i)          always 1.
  4461.  
  4462.        This function removes variables from the WIL Interpreter's variable
  4463.        list, and recovers the memory associated with the variable (and
  4464.        possibly related string storage).
  4465.  
  4466.  
  4467.        Example:
  4468.         a = "A variable"
  4469.         b = "Another one"
  4470.         Drop(a, b)       ; This removes A and B from memory
  4471.  
  4472.  
  4473.        See Also:
  4474.           IsDefined
  4475.  
  4476.  
  4477.  
  4478.  
  4479.        Else
  4480.        Continues a previous If statement.
  4481.  
  4482.  
  4483.  
  4484.  
  4485.  
  4486.  
  4487.        Syntax:
  4488.         Else statement
  4489.  
  4490.        Parameters:
  4491.         (s) statement any valid WIL function or command.
  4492.  
  4493.        This command continues the last-encountered If command.  It allows the
  4494.        user to specify an alternate action to be taken if the If condition
  4495.        was false.  If the previous If condition was false, the statement
  4496.        following the Else keyword is executed.  If the previous If condition
  4497.        was true, the statement following the Else keyword is ignored.
  4498.  
  4499.  
  4500.        Example:
  4501.         windir = DirWindows(0)
  4502.         inifiles = FileItemize("%windir%*.ini")
  4503.         ini = ItemSelect("INI file to edit", inifiles, " ")
  4504.         If ini == "" Then Exit
  4505.         Else Run("notepad.exe", ini)
  4506.  
  4507.  
  4508.        See Also:
  4509.           Goto, If ... Then, Then
  4510.  
  4511.  
  4512.  
  4513.  
  4514.        EndSession
  4515.        Ends the Windows session.
  4516.  
  4517.  
  4518.        Syntax:
  4519.         EndSession ( )
  4520.  
  4521.        Parameters:
  4522.         (none)
  4523.  
  4524.        Returns:
  4525.         (i)          always 0.
  4526.  
  4527.        Use this command to end the Windows session.
  4528.  
  4529.  
  4530.        Example:
  4531.         sure = AskYesNo ("End Session", "You SURE you want to exit 
  4532.             Windows?")
  4533.         If sure == @No Then Goto cancel
  4534.         EndSession()
  4535.         :cancel
  4536.         Message("", "Exit Windows canceled")
  4537.  
  4538.  
  4539.        See Also:
  4540.           Exit, WinClose, WinCloseNot
  4541.  
  4542.  
  4543.  
  4544.  
  4545.  
  4546.  
  4547.  
  4548.  
  4549.        Environment
  4550.        Gets a DOS environment variable.
  4551.  
  4552.  
  4553.        Syntax:
  4554.         Environment (env-variable)
  4555.  
  4556.        Parameters:
  4557.         (s) env-variable   any defined environment variable.
  4558.  
  4559.        Returns:
  4560.         (s)          environment variable contents.
  4561.  
  4562.        Use this function to get the value of a DOS environment variable.
  4563.  
  4564.        Note: It is not possible to change a DOS environment variable.
  4565.  
  4566.  
  4567.        Example:
  4568.         ; Display the PATH for this DOS session
  4569.         currpath = Environment("PATH")
  4570.         Message("Current DOS Path", currpath)
  4571.  
  4572.  
  4573.        See Also:
  4574.           IniRead, Version, WinMetrics, WinParmGet
  4575.  
  4576.  
  4577.  
  4578.  
  4579.        ErrorMode
  4580.        Specifies how to handle errors.
  4581.  
  4582.  
  4583.        Syntax:
  4584.         ErrorMode (mode)
  4585.  
  4586.        Parameters:
  4587.         (i) mode     @CANCEL or @NOTIFY or @OFF.
  4588.  
  4589.        Returns:
  4590.         (i)          previous error setting.
  4591.  
  4592.        Use this function to control the effects of runtime errors.  The
  4593.        default is @CANCEL, meaning the execution of the WIL program will be
  4594.        canceled upon any error.
  4595.  
  4596.        @CANCEL:  All runtime errors will cause execution to be canceled.  The
  4597.        user will be notified which error occurred.
  4598.  
  4599.        @NOTIFY:  All runtime errors will be reported to the user, and the
  4600.        user can choose to continue if it isn't fatal.
  4601.  
  4602.  
  4603.  
  4604.  
  4605.  
  4606.        @OFF:  Minor runtime errors will be suppressed. Moderate and fatal
  4607.        errors will be reported to the user.  User has the option of
  4608.        continuing if the error is not fatal.
  4609.  
  4610.        In general, we suggest the normal state of the program should be
  4611.        ErrorMode(@CANCEL), especially if you are writing a WIL program for
  4612.        others to use.  You can always suppress errors you expect will occur
  4613.        and then re-enable ErrorMode (@CANCEL).
  4614.  
  4615.  
  4616.        Example:
  4617.         ; Delete xxxtest.xyz.  If file doesn't exist,
  4618.         ; continue execution; don't stop
  4619.         prevmode = ErrorMode(@OFF)
  4620.         FileDelete("c:\xxxtest.xyz")
  4621.         ErrorMode(prevmode)
  4622.  
  4623.  
  4624.        See Also:
  4625.           Debug, Execute, LastError
  4626.  
  4627.  
  4628.  
  4629.  
  4630.        Exclusive
  4631.        Controls whether or not other Windows programs will get any time to
  4632.        execute.
  4633.  
  4634.  
  4635.        Syntax:
  4636.         Exclusive (mode)
  4637.  
  4638.        Parameters:
  4639.         (i) mode     @ON or @OFF.
  4640.  
  4641.        Returns:
  4642.         (i)          previous Exclusive mode.
  4643.  
  4644.        Exclusive(@OFF) is the default mode.  In this mode,the WIL Interpreter
  4645.        is well-behaved toward other Windows applications.
  4646.  
  4647.        Exclusive(@ON) allows WIL programs to run somewhat faster, but causes
  4648.        the WIL Interpreter to be "greedier" about sharing processing time
  4649.        with other active Windows applications.  For the most part, this mode
  4650.        is useful only when you have a series of WIL statements which must be
  4651.        executed in quick succession.
  4652.  
  4653.  
  4654.  
  4655.  
  4656.  
  4657.  
  4658.        Example:
  4659.         Exclusive(@ON)
  4660.         x = 0
  4661.         start = DateTime()
  4662.         :add
  4663.         x = x + 1
  4664.         If x < 1000 Then Goto add
  4665.         stop = DateTime()
  4666.         crlf = StrCat(Num2Char(13), Num2Char(10))
  4667.         Message("Times", "Start: %start%%crlf%Stop:  %stop%")
  4668.         Exclusive(@OFF)
  4669.  
  4670.  
  4671.        See Also:
  4672.           Yield
  4673.  
  4674.  
  4675.  
  4676.  
  4677.        Execute
  4678.        Executes a statement in a protected environment.  Any errors
  4679.        encountered are recoverable.
  4680.  
  4681.  
  4682.        Syntax:
  4683.         Execute statement
  4684.  
  4685.        Parameters:
  4686.         (s) statement any executable WIL statement.
  4687.  
  4688.        Returns:
  4689.         (not applicable)
  4690.  
  4691.        Use this command to execute computed or user-entered statements.  Due
  4692.        to the built-in error recovery associated with Execute, it is ideal
  4693.        for interactive execution of user-entered commands.
  4694.  
  4695.        Note that the Execute command doesn't operate on a string, per se, but
  4696.        rather on a direct statement.  If you want to put a code segment into
  4697.        a string variable, you must use the substitution feature of the
  4698.        language, as in the example below.
  4699.  
  4700.  
  4701.        Example:
  4702.         cmd = ""
  4703.         cmd = AskLine("WIL Interactive", "Command:", cmd)
  4704.         Execute %cmd%
  4705.  
  4706.  
  4707.        See Also:
  4708.           ErrorMode
  4709.  
  4710.  
  4711.  
  4712.  
  4713.  
  4714.  
  4715.  
  4716.  
  4717.        Exit
  4718.        Unconditionally ends a WIL program.
  4719.  
  4720.  
  4721.        Syntax:
  4722.         Exit
  4723.  
  4724.        Parameters:
  4725.         (none)
  4726.  
  4727.        Returns:
  4728.         (not applicable)
  4729.  
  4730.        Use this command to immediately terminate a WIL program.  An Exit is
  4731.        implied at the end of each WIL program, and so is not necessary there.
  4732.  
  4733.  
  4734.        Example:
  4735.         a = 100
  4736.         Message("The value of a is", a)
  4737.         Exit
  4738.  
  4739.  
  4740.        See Also:
  4741.           Pause, Return, Terminate
  4742.  
  4743.  
  4744.  
  4745.  
  4746.        FileAppend
  4747.        Appends one or more files to another file.
  4748.  
  4749.  
  4750.        Syntax:
  4751.         FileAppend (source-list, destination)
  4752.  
  4753.        Parameters:
  4754.         (s) source-list    a string containing one or more filenames, which
  4755.                      may be wildcarded.
  4756.         (s) destination    target file name.
  4757.  
  4758.        Returns:
  4759.         (i)          @TRUE if all files were appended successfully;
  4760.                      @FALSE if at least one file wasn't appended.
  4761.  
  4762.        Use this function to append an individual file or a group of files to
  4763.        the end of an existing file.  If destination does not exist, it will
  4764.        be created.
  4765.  
  4766.        The file(s) specified in source-list will not be modified by this
  4767.        function.
  4768.  
  4769.        Source-list may contain * and ? wildcards.  Destination may not
  4770.        contain wildcards of any type; it must be a single file name.
  4771.  
  4772.  
  4773.  
  4774.  
  4775.  
  4776.  
  4777.        Examples:
  4778.         FileAppend("c:\config.sys", "c:\misc\config.sav")
  4779.  
  4780.         DirChange("c:\batch")
  4781.         FileDelete("allbats.fil")
  4782.         FileAppend("*.bat", "allbats.fil")
  4783.  
  4784.  
  4785.        See Also:
  4786.           FileCopy, FileDelete, FileExist
  4787.  
  4788.  
  4789.  
  4790.  
  4791.        FileAttrGet
  4792.        Returns file attributes.
  4793.  
  4794.  
  4795.        Syntax:
  4796.         FileAttrGet (filename)
  4797.  
  4798.        Parameters:
  4799.         (s) filename file whose attributes you want to determine.
  4800.  
  4801.        Returns:
  4802.         (s)          attribute settings.
  4803.  
  4804.        Returns attributes for the specified file, in a string of the form
  4805.        "RASH".  This string is composed of four individual attribute
  4806.        characters, as follows:
  4807.  
  4808.           Char   Symbol    Meaning
  4809.  
  4810.           1      R    Read-only ON
  4811.           2      A    Archive ON
  4812.           3      S    System ON
  4813.           4      H    Hidden ON
  4814.  
  4815.        A hyphen in any of these positions indicates that the specified
  4816.        attribute is OFF.  For example, the string "-A-H" indicates a file
  4817.        which has the Archive and Hidden attributes set.
  4818.  
  4819.  
  4820.        Example:
  4821.         editfile = "c:\config.sys"
  4822.         attr = FileAttrGet(editfile)
  4823.         If StrSub(attr, 1, 1) == "R" Then Goto readonly
  4824.         Run("notepad.exe", editfile)
  4825.         Exit
  4826.         :readonly
  4827.         Message("File is read-only", "Cannot edit %editfile%")
  4828.  
  4829.  
  4830.        See Also:
  4831.           FileAttrSet, FileTimeGet
  4832.  
  4833.  
  4834.  
  4835.  
  4836.  
  4837.  
  4838.  
  4839.  
  4840.        FileAttrSet
  4841.        Sets file attributes.
  4842.  
  4843.  
  4844.        Syntax:
  4845.         FileAttrSet (file-list, settings)
  4846.  
  4847.        Parameters:
  4848.         (s) file-list space-delimited list of files.
  4849.         (s) settings new attribute settings for those file(s).
  4850.  
  4851.        Returns:
  4852.         (i)          always 0.
  4853.  
  4854.        The attribute string consists of one or more of the following
  4855.        characters (an upper case letter turns the specified attribute ON, a
  4856.        lower case letter turns it OFF):
  4857.  
  4858.           R read only ON
  4859.           A archive ON
  4860.           S system ON
  4861.           H hidden ON
  4862.  
  4863.           r read only OFF
  4864.           a archive OFF
  4865.           s system OFF
  4866.           h hidden OFF
  4867.  
  4868.  
  4869.        Examples:
  4870.         FileAttrSet("win.ini system.ini", "rAsH")
  4871.  
  4872.         FileAttrSet("c:\command.com", "R")
  4873.  
  4874.  
  4875.        See Also:
  4876.           FileAttrGet, FileTimeTouch
  4877.  
  4878.  
  4879.  
  4880.  
  4881.        FileClose
  4882.        Closes a file.
  4883.  
  4884.  
  4885.        Syntax:
  4886.         FileClose (filehandle)
  4887.  
  4888.        Parameters:
  4889.         (i) filehandle     same integer that was returned by FileOpen.
  4890.  
  4891.        Returns:
  4892.         (i)          always 0.
  4893.  
  4894.  
  4895.  
  4896.  
  4897.  
  4898.  
  4899.        Example:
  4900.         ; the hard way to copy an ASCII file
  4901.         old = FileOpen("config.sys", "READ")
  4902.         new = FileOpen("sample.txt", "WRITE")
  4903.         :top
  4904.         x = FileRead(old)
  4905.         If x != "*EOF*" Then FileWrite(new, x)
  4906.         If x != "*EOF*" Then Goto top
  4907.         FileClose(new)
  4908.         FileClose(old)
  4909.  
  4910.  
  4911.        See Also:
  4912.           FileOpen, FileRead, FileWrite
  4913.  
  4914.  
  4915.  
  4916.  
  4917.        FileCopy
  4918.        Copies files.
  4919.  
  4920.  
  4921.        Syntax:
  4922.         FileCopy (source-list, destination, warning)
  4923.  
  4924.        Parameters:
  4925.         (s) source-list    a string containing one or more filenames, which
  4926.                      may be wildcarded.
  4927.         (s) destination    target file name.
  4928.         (i) warning  @TRUE if you want a warning before overwriting existing
  4929.                      files;
  4930.                      @FALSE if no warning desired.
  4931.  
  4932.        Returns:
  4933.         (i)          @TRUE if all files were copied successfully;
  4934.                      @FALSE if at least one file wasn't copied.
  4935.  
  4936.        Use this function to copy an individual file, a group of files using
  4937.        wildcards, or several groups of files by separating the names with
  4938.        spaces.
  4939.  
  4940.        You can also copy files to any COM or LPT device.
  4941.  
  4942.        Source-list may contain * and ? wildcards.  Destination may contain
  4943.        the * wildcard only.
  4944.  
  4945.  
  4946.        Examples:
  4947.         FileCopy("c:\config.sys", "d:", @FALSE)
  4948.  
  4949.         FileCopy("c:\*.sys", "d:devices\*.sys", @TRUE)
  4950.  
  4951.         FileCopy("c:\config.sys", "LPT1", @FALSE)
  4952.  
  4953.  
  4954.  
  4955.  
  4956.  
  4957.  
  4958.        See Also:
  4959.           FileDelete, FileExist, FileLocate, FileMove, FileRename
  4960.  
  4961.  
  4962.  
  4963.  
  4964.        FileDelete
  4965.        Deletes files.
  4966.  
  4967.  
  4968.        Syntax:
  4969.         FileDelete (file-list)
  4970.  
  4971.        Parameters:
  4972.         (s) file-list a string containing one or more filenames, which may be
  4973.                      wildcarded.
  4974.  
  4975.        Returns:
  4976.         (i)          @TRUE if all the files were deleted;
  4977.                      @FALSE if a file didn't exist or is marked with the
  4978.                      READ-ONLY attribute.
  4979.  
  4980.        Use this function to delete an individual file, a group of files using
  4981.        wildcards, or several groups of files by separating the names with
  4982.        spaces.
  4983.  
  4984.  
  4985.        Example:
  4986.         FileDelete("*.bak temp???.fil")
  4987.  
  4988.  
  4989.        See Also:
  4990.           FileExist, FileLocate, FileMove, FileRename
  4991.  
  4992.  
  4993.  
  4994.  
  4995.        FileExist
  4996.        Tests for the existence of files.
  4997.  
  4998.  
  4999.        Syntax:
  5000.         FileExist (filename)
  5001.  
  5002.        Parameters:
  5003.         (s) filename either a fully qualified filename with drive and path,
  5004.                      or just a filename and extension.
  5005.  
  5006.        Returns:
  5007.         (i)          @TRUE if the file exists;
  5008.                      @FALSE if it doesn't exist or if the pathname is
  5009.                      invalid.
  5010.  
  5011.        This function is used to test whether or not a specified file exists.
  5012.  
  5013.  
  5014.  
  5015.  
  5016.  
  5017.        If a fully-qualified file name is used, only the specified drive and
  5018.        directory will be checked for the desired file.  If only the root and
  5019.        extension are specified, then first the current directory is checked
  5020.        for the file, and then, if the file is not found in the current
  5021.        directory, all directories in the DOS path are searched.
  5022.  
  5023.  
  5024.        Examples:
  5025.         ; check for file in current directory
  5026.         fex = FileExist(StrCat(DirGet(), "myfile.txt"))
  5027.         tex = StrSub("NOT", 1, StrLen("NOT") * fex)
  5028.         Message("MyFile.Txt"," Is %tex%in the current directory")
  5029.  
  5030.         ; check for file someplace along path
  5031.         fex = FileExist("myfile.txt")
  5032.         tex = StrSub("NOT", 1, StrLen("NOT") * fex)
  5033.         Message("MyFile.Txt", " Is %tex% in the DOS path")
  5034.  
  5035.  
  5036.        See Also:
  5037.           FileLocate
  5038.  
  5039.  
  5040.  
  5041.  
  5042.        FileExtension
  5043.        Returns extension of file.
  5044.  
  5045.  
  5046.        Syntax:
  5047.         FileExtension (filename)
  5048.  
  5049.        Parameters:
  5050.         (s) filename [optional path]full file name, including extension.
  5051.  
  5052.        Returns:
  5053.         (s)          file extension.
  5054.  
  5055.        This function parses the passed filename and returns the extension
  5056.        part of the filename.
  5057.  
  5058.        Example:
  5059.         ; prevent the user from editing a COM or EXE file
  5060.         allfiles = FileItemize("*.*")
  5061.         editfile = ItemSelect("Select file to edit", allfiles, " ")
  5062.         ext = FileExtension(editfile)
  5063.         If (ext == "com") || (ext == "exe") Then Goto noedit
  5064.         run("notepad.exe", editfile)
  5065.         exit
  5066.         :noedit
  5067.         Message ("Sorry", "You may not edit a program file")
  5068.  
  5069.  
  5070.        See Also:
  5071.           DialogBox, FilePath, FileRoot
  5072.  
  5073.  
  5074.  
  5075.  
  5076.  
  5077.  
  5078.  
  5079.  
  5080.        FileItemize
  5081.        Returns a space-delimited list of files.
  5082.  
  5083.  
  5084.        Syntax:
  5085.         FileItemize (file-list)
  5086.  
  5087.        Parameters:
  5088.         (s) file-list a string containing a list of filenames, which may be
  5089.                      wildcarded.
  5090.  
  5091.        Returns:
  5092.         (s)          space-delimited list of files.
  5093.  
  5094.        This function compiles a list of filenames and separates the names
  5095.        with spaces.
  5096.  
  5097.        This is especially useful in conjunction with the ItemSelect function,
  5098.        which lets the user choose an item from such a space-delimited list.
  5099.  
  5100.        Note: Some shell or file manager applications using the WIL
  5101.        Interpreter allow an empty string ("") to be used as the "file-list"
  5102.        parameter, in which case all files highlighted in the file display are
  5103.        returned.  However, if there are any file names or wildcards in the
  5104.        string, all files matching the file names are returned, regardless of
  5105.        which ones are highlighted.
  5106.  
  5107.  
  5108.        Examples:
  5109.         FileItemize("*.bak")         ;all BAK files
  5110.  
  5111.         FileItemize("*.arc *.zip *.lzh")  ;compressed files
  5112.  
  5113.         ; Get which .INI file to edit
  5114.         ifiles = FileItemize("c:\windows\*.ini")
  5115.         ifile = ItemSelect(".INI Files", ifiles, " ")
  5116.         RunZoom("notepad", ifile)
  5117.         Drop(ifiles, ifile)
  5118.  
  5119.  
  5120.        See Also:
  5121.           CurrentFile, DirItemize, ItemSelect, TextSelect, WinItemize
  5122.  
  5123.  
  5124.  
  5125.  
  5126.        FileLocate
  5127.        Finds file in current directory or along the DOS path.
  5128.  
  5129.  
  5130.        Syntax:
  5131.         FileLocate (filename)
  5132.  
  5133.  
  5134.  
  5135.  
  5136.  
  5137.  
  5138.        Parameters:
  5139.         (s) filename full file name, including extension.
  5140.  
  5141.        Returns:
  5142.         (s)          fully-qualified path name.
  5143.  
  5144.        This function is used to obtain the fully qualified path name of a
  5145.        file.  The current directory is checked first, and if the file is not
  5146.        found, the DOS path is searched.  The first occurrence of the file is
  5147.        returned.
  5148.  
  5149.  
  5150.        Example:
  5151.         ; Edit WIN.INI
  5152.         winini = FileLocate("win.ini")
  5153.         If winini == "" Then Goto notfound
  5154.         Run("notepad.exe", winini)
  5155.         Exit
  5156.         :notfound
  5157.         Message("???", "WIN.INI not found")
  5158.  
  5159.  
  5160.        See Also:
  5161.           FileExist
  5162.  
  5163.  
  5164.  
  5165.  
  5166.        FileMove
  5167.        Moves files.
  5168.  
  5169.  
  5170.        Syntax:
  5171.         FileMove (source-list, destination, warning)
  5172.  
  5173.        Parameters:
  5174.         (s) source-list    one or more filenames separated by spaces.
  5175.         (s) destination    target filename.
  5176.         (i) warning  @TRUE if you want a warning before overwriting existing
  5177.                      files;
  5178.                      @FALSE if no warning desired.
  5179.  
  5180.        Returns:
  5181.         (i)          @TRUE if the file was moved;
  5182.                      @FALSE if the source file was not found or had the READ-
  5183.                      ONLY attribute, or the target filename is invalid.
  5184.  
  5185.        Use this function to move an individual file, a group of files using
  5186.        wildcards, or several groups of files by separating the names with
  5187.        spaces.
  5188.  
  5189.        You can also move files to another drive, or to any COM or LPT device.
  5190.  
  5191.        Source-list may contain * and ? wildcards.  Destination may contain
  5192.        the * wildcard only.
  5193.  
  5194.  
  5195.  
  5196.  
  5197.  
  5198.  
  5199.        Examples:
  5200.         FileMove("c:\config.sys", "d:", @FALSE)
  5201.  
  5202.         FileMove("c:\*.sys", "d:*.sys", @TRUE)
  5203.  
  5204.  
  5205.        See Also:
  5206.           FileCopy, FileDelete, FileExist, FileLocate, FileRename
  5207.  
  5208.  
  5209.  
  5210.  
  5211.        FileOpen
  5212.        Opens a STANDARD ASCII (only) file for reading or writing.
  5213.  
  5214.  
  5215.        Syntax:
  5216.         FileOpen (filename, open-type)
  5217.  
  5218.        Parameters:
  5219.         (s) filename name of the file to open.
  5220.         (s) open-type "READ" or "WRITE".
  5221.  
  5222.        Returns:
  5223.         (i)          filehandle
  5224.  
  5225.        The filehandle returned by the FileOpen function may be subsequently
  5226.        used by the FileRead, FileWrite, and FileClose functions.
  5227.  
  5228.  
  5229.        Examples:
  5230.         ; To open for reading:
  5231.         handle = FileOpen("stuff.txt", "READ")
  5232.  
  5233.         ; To open for writing:
  5234.         handle = FileOpen("stuff.txt", "WRITE")
  5235.  
  5236.  
  5237.        See Also:
  5238.           FileClose, FileRead, FileWrite
  5239.  
  5240.  
  5241.  
  5242.  
  5243.        FilePath
  5244.        Returns path of file.
  5245.  
  5246.  
  5247.        Syntax:
  5248.         FilePath (filename)
  5249.  
  5250.        Parameters:
  5251.         (s) filename fully qualified file name, including path.
  5252.  
  5253.        Returns:
  5254.         (s)          fully qualified path name.
  5255.  
  5256.  
  5257.  
  5258.  
  5259.  
  5260.  
  5261.  
  5262.        FilePath parses the passed filename and returns the drive and path of
  5263.        the file specification, if any.
  5264.  
  5265.        Example:
  5266.         coms = Environment("COMSPEC")
  5267.         compath = FilePath(coms)
  5268.         Message("", "Your command processor is located in %compath%")
  5269.  
  5270.  
  5271.        See Also:
  5272.           FileExtension, FileRoot
  5273.  
  5274.  
  5275.  
  5276.  
  5277.        FileRead
  5278.        Reads data from a file.
  5279.  
  5280.  
  5281.        Syntax:
  5282.         FileRead (filehandle)
  5283.  
  5284.        Parameters:
  5285.         (i) filehandle     same integer that was returned by FileOpen.
  5286.  
  5287.        Returns:
  5288.         (s)          line of data read from file.
  5289.  
  5290.  
  5291.        When the end of the file is reached, the string *EOF* will be
  5292.        returned.
  5293.  
  5294.  
  5295.        Example:
  5296.         handle = FileOpen("autoexec.bat", "READ")
  5297.         :top
  5298.         line = FileRead(handle)
  5299.         Display(4, "AUTOEXEC DATA", line)
  5300.         If line != "*EOF*" Then Goto top
  5301.         FileClose(handle)
  5302.  
  5303.  
  5304.        See Also:
  5305.           FileClose, FileOpen, FileWrite
  5306.  
  5307.  
  5308.  
  5309.  
  5310.        FileRename
  5311.        Renames files.
  5312.  
  5313.  
  5314.        Syntax:
  5315.         FileRename (source-list, destination)
  5316.  
  5317.  
  5318.  
  5319.  
  5320.  
  5321.  
  5322.        Parameters:
  5323.         (s) source-list    one or more filenames, separated by spaces.
  5324.         (s) destination    target filename.
  5325.  
  5326.        Returns:
  5327.         (i)          @TRUE if the file was renamed;
  5328.                      @FALSE if the source file was not found or had the READ-
  5329.                      ONLY attribute, or the target filename is invalid.
  5330.  
  5331.        Use this function to rename an individual file, a group of files using
  5332.        wildcards, or several groups of files by separating the names with
  5333.        spaces.
  5334.  
  5335.        Note: Unlike FileMove, you cannot make a file change its resident disk
  5336.        drive with FileRename.
  5337.  
  5338.        Source-list may contain * and ? wildcards.  Destination may contain
  5339.        the * wildcard only.
  5340.  
  5341.  
  5342.        Examples:
  5343.         FileRename("c:\config.sys", "config.old")
  5344.  
  5345.         FileRename("c:\*.txt", "*.bak")
  5346.  
  5347.  
  5348.        See Also:
  5349.           FileCopy, FileExist, FileLocate, FileMove
  5350.  
  5351.  
  5352.  
  5353.  
  5354.        FileRoot
  5355.        Returns root of file.
  5356.  
  5357.  
  5358.        Syntax:
  5359.         FileRoot (filename)
  5360.  
  5361.        Parameters:
  5362.         (s) filename [optional path]full file name, including extension.
  5363.  
  5364.        Returns:
  5365.         (s)          file root.
  5366.  
  5367.  
  5368.        FileRoot parses the passed filename and returns the root part of the
  5369.        filename.
  5370.  
  5371.  
  5372.  
  5373.  
  5374.  
  5375.  
  5376.        Example:
  5377.         allfiles = FileItemize("*.*")
  5378.         editfile = ItemSelect("Select file to edit", allfiles, " ")
  5379.         root = FileRoot(editfile)
  5380.         ext = FileExtension(editfile)
  5381.         lowerext = StrLower(ext)
  5382.         nicefile = StrCat(root, ".", lowerext)
  5383.         Message("", "You are about to edit %nicefile%.")
  5384.         Run("notepad.exe", editfile)
  5385.  
  5386.  
  5387.        See Also:
  5388.           FileExtension, FilePath
  5389.  
  5390.  
  5391.  
  5392.  
  5393.        FileSize
  5394.        Finds the total size of a group of files.
  5395.  
  5396.  
  5397.        Syntax:
  5398.         FileSize (file-list)
  5399.  
  5400.        Parameters:
  5401.         (s) file-list zero or more filenames, separated by spaces.
  5402.  
  5403.        Returns:
  5404.         (i)          total bytes taken up by the specified file(s).
  5405.  
  5406.        This function returns the total size of the specified files.  Note
  5407.        that it doesn't handle wildcarded filenames.  You can, however, use
  5408.        FileItemize on a wildcarded filename and use the resulting string as a
  5409.        FileSize parameter.
  5410.  
  5411.  
  5412.        Example:
  5413.         size = FileSize(FileItemize("*.*"))
  5414.         Message("Size of All Files in Directory", size)
  5415.  
  5416.  
  5417.        See Also:
  5418.           DiskFree
  5419.  
  5420.  
  5421.  
  5422.  
  5423.        FileTimeGet
  5424.        Returns file date and time.
  5425.  
  5426.  
  5427.        Syntax:
  5428.         FileTimeGet (filename)
  5429.  
  5430.        Parameters:
  5431.         (s) filename name of file for which you want the date and time.
  5432.  
  5433.  
  5434.  
  5435.  
  5436.  
  5437.  
  5438.        Returns:
  5439.         (s)          file date and time.
  5440.  
  5441.        This function will return the date and time of a file, in a pre-
  5442.        formatted string.  The format it is returned in depends on the date
  5443.        format specified in the [Intl] section of the WIN.INI file:
  5444.  
  5445.        mm/dd/yy  hh:mmXX
  5446.        dd/mm/yy  hh:mmXX
  5447.        yy/mm/dd  hh:mmXX
  5448.  
  5449.        Where:
  5450.           mm  is the month (e.g. 10)
  5451.           dd  is the day of the month (e.g. 23)
  5452.           yy  is the year (e.g. 90)
  5453.           hh  is the hours
  5454.           mm  is the minutes
  5455.           XX  is the Day/Night code (e.g. AM or PM)
  5456.  
  5457.        There are two spaces between the date and the time.
  5458.  
  5459.        The WIN.INI file will be examined to determine which format to use.
  5460.        You can adjust the WIN.INI file via the International section of
  5461.        Control Panel if the format isn't what you prefer.
  5462.  
  5463.  
  5464.        Example:
  5465.         oldtime = FileTimeGet("win.ini")
  5466.         Run("notepad.exe", "win.ini")
  5467.         WinWaitClose("Notepad - WIN.INI")
  5468.         newtime = FileTimeGet("win.ini")
  5469.         If StrCmp(oldtime, newtime) == 0 Then Exit
  5470.         Message("", "WIN.INI has been changed")
  5471.  
  5472.  
  5473.        See Also:
  5474.           DateTime, FileAttrGet, FileTimeTouch
  5475.  
  5476.  
  5477.  
  5478.  
  5479.        FileTimeTouch
  5480.        Sets file(s) to current time.
  5481.  
  5482.  
  5483.        Syntax:
  5484.         FileTimeTouch (file-list)
  5485.  
  5486.        Parameters:
  5487.         (s) file-list a space-delimited list of files
  5488.  
  5489.        Returns:
  5490.         (i)          always 0
  5491.  
  5492.  
  5493.  
  5494.  
  5495.  
  5496.        File-list is a space-delimited list of files, which may not contain
  5497.        wildcards.  The path is searched if the file is not found in current
  5498.        directory and if the directory is not specified in file-list.
  5499.  
  5500.  
  5501.        Example:
  5502.         FileTimeTouch("wac.c wac.rc")
  5503.         Run("make.exe", "-fwac.mak")
  5504.  
  5505.  
  5506.        See Also:
  5507.           FileAttrSet, FileTimeGet
  5508.  
  5509.  
  5510.  
  5511.  
  5512.        FileWrite
  5513.        Writes data to a file.
  5514.  
  5515.  
  5516.        Syntax:
  5517.         FileWrite (filehandle, output-data)
  5518.  
  5519.        Parameters:
  5520.         (i) filehandle     same integer that was returned by FileOpen.
  5521.         (s) output-data    data to write to file.
  5522.  
  5523.        Returns:
  5524.         (i)          always 0.
  5525.  
  5526.  
  5527.  
  5528.        Example:
  5529.         handle = FileOpen("stuff.txt", "WRITE")
  5530.         FileWrite(handle, "Gobbledygook")
  5531.         FileClose(handle)
  5532.  
  5533.  
  5534.        See Also:
  5535.           FileClose, FileOpen, FileRead
  5536.  
  5537.  
  5538.  
  5539.  
  5540.        Goto
  5541.        Changes the flow of control in a WIL program.
  5542.  
  5543.  
  5544.        Syntax:
  5545.         Goto label
  5546.  
  5547.        Parameters:
  5548.         (s) label    user-defined identifier.
  5549.  
  5550.        Goto label causes an unconditional branch to the line in the program
  5551.        marked :label, where the identifier is preceded by a colon (:).
  5552.  
  5553.  
  5554.  
  5555.  
  5556.  
  5557.  
  5558.        Example:
  5559.         If WinExist("Solitaire") == @FALSE Then Goto open
  5560.         WinActivate("Solitaire")
  5561.         Goto loaded
  5562.         :open
  5563.         Run("sol.exe", "")
  5564.         :loaded
  5565.  
  5566.  
  5567.        See Also:
  5568.           Else, If ... Then, Then
  5569.  
  5570.  
  5571.  
  5572.  
  5573.        IconArrange
  5574.        Rearranges icons.
  5575.  
  5576.  
  5577.        Syntax:
  5578.         IconArrange ( )
  5579.  
  5580.        Parameters:
  5581.         (none)
  5582.  
  5583.        Returns:
  5584.         (i)          always 0.
  5585.  
  5586.        This function rearranges the icons at the bottom of the screen,
  5587.        spacing them evenly.  It does not change the order in which the icons
  5588.        appear.
  5589.  
  5590.  
  5591.        Example:
  5592.         IconArrange ( )
  5593.  
  5594.  
  5595.        See Also:
  5596.           RunIcon, WinArrange, WinIconize, WinPlaceSet
  5597.  
  5598.  
  5599.  
  5600.  
  5601.        If...Then
  5602.        Conditionally performs a function.
  5603.  
  5604.  
  5605.        Syntax:
  5606.         If condition Then statement
  5607.  
  5608.        Parameters:
  5609.         (s) condition an expression to be evaluated.
  5610.         (s) statement any valid WIL function or command.
  5611.  
  5612.        If the condition following the If keyword is true, the statement
  5613.        following the Then keyword is executed.  If the condition following
  5614.  
  5615.  
  5616.  
  5617.  
  5618.  
  5619.        the If keyword is false, the statement following the Then keyword is
  5620.        ignored.
  5621.  
  5622.        See the Else and Then commands for additional flexibility in
  5623.        conditional processing.
  5624.  
  5625.  
  5626.        Example:
  5627.         sure = AskYesNo("End Session", "Really quit Windows?")
  5628.         If sure == @YES Then EndSession()
  5629.  
  5630.  
  5631.        See Also:
  5632.           Else, Goto, Then
  5633.  
  5634.  
  5635.  
  5636.  
  5637.        IgnoreInput
  5638.        Turns off hardware input to windows.
  5639.  
  5640.  
  5641.        Syntax:
  5642.         IgnoreInput (mode)
  5643.  
  5644.        Parameters:
  5645.         (i) mode     @TRUE or @FALSE.
  5646.  
  5647.        Returns:
  5648.         (i)          previous IgnoreInput mode.
  5649.  
  5650.  
  5651.        IgnoreInput causes mouse movements, clicks and keyboard entry to be
  5652.        completely ignored.  Good for self-running demos.
  5653.  
  5654.        Warning: If you are not careful with the use of IgnoreInput, you can
  5655.        lock up your computer!
  5656.  
  5657.  
  5658.        Example:
  5659.         username = AskLine("Hello", "Please enter your name","")
  5660.         IgnoreInput(@TRUE)
  5661.         Call("demo.wbt", username)
  5662.         IgnoreInput(@FALSE)
  5663.  
  5664.  
  5665.        See Also:
  5666.           WaitForKey
  5667.  
  5668.  
  5669.  
  5670.  
  5671.        IniDelete
  5672.        Removes a line or section from WIN.INI.
  5673.  
  5674.  
  5675.  
  5676.  
  5677.  
  5678.  
  5679.        Syntax:
  5680.         IniDelete (section, keyname)
  5681.  
  5682.        Parameters:
  5683.         (s) section  the major heading under which the item is located.
  5684.         (s) keyname  the name of the item to delete.
  5685.  
  5686.        Returns:
  5687.         (i)          always 0
  5688.  
  5689.        This function will remove the specified line from the specified
  5690.        section in WIN.INI.  You can remove an entire section, instead of just
  5691.        a single line, by specifying a keyword of @WHOLESECTION.  Case is not
  5692.        significant in section or keyname.
  5693.  
  5694.  
  5695.        Examples:
  5696.         IniDelete("Desktop", "Wallpaper")
  5697.  
  5698.         IniDelete("Quicken",@WHOLESECTION)
  5699.  
  5700.  
  5701.        See Also:
  5702.           IniDeletePvt, IniItemize, IniRead, IniWrite
  5703.  
  5704.  
  5705.  
  5706.  
  5707.        IniDeletePvt
  5708.        Removes a line or section from a private INI file.
  5709.  
  5710.  
  5711.        Syntax:
  5712.         IniDeletePvt (section, keyname, filename)
  5713.  
  5714.        Parameters:
  5715.         (s) section  the major heading under which the item is located.
  5716.         (s) keyname  the name of the item to delete.
  5717.         (s) filename name of the INI file.
  5718.  
  5719.        Returns:
  5720.         (i)          always 0.
  5721.  
  5722.        This function will remove the specified line from the specified
  5723.        section in a private INI file.  You can remove an entire section,
  5724.        instead of just a single line, by specifying a keyword of
  5725.        @WHOLESECTION.  Case is not significant in section or keyname.
  5726.  
  5727.  
  5728.        Example:
  5729.         IniDeletePvt("Current Users", "Excel", "meter.ini")
  5730.  
  5731.  
  5732.        See Also:
  5733.           IniDelete, IniItemizePvt, IniReadPvt, IniWritePvt
  5734.  
  5735.  
  5736.  
  5737.  
  5738.  
  5739.  
  5740.  
  5741.  
  5742.        IniItemize
  5743.        Lists keywords or sections in WIN.INI.
  5744.  
  5745.  
  5746.        Syntax:
  5747.         IniItemize (section)
  5748.  
  5749.        Parameters:
  5750.         (s) section  the major heading to itemize.
  5751.  
  5752.        Returns:
  5753.         (s)          list of keywords or sections.
  5754.  
  5755.        IniItemize will scan the specified section in WIN.INI, and return a
  5756.        tab-delimited list of all keyword names contained within that section.
  5757.        If a null string ("") is given as the section name, IniItemize will
  5758.        return a list of all section names contained within WIN.INI.  Returns
  5759.        "(None)" if the specified section does not exist; returns a null
  5760.        string ("") if the section exists but is empty.  Case is not
  5761.        significant in section names.
  5762.  
  5763.  
  5764.        Examples:
  5765.         ; Returns all keywords in the [Extensions] section
  5766.         keywords = IniItemize("Extensions")
  5767.  
  5768.         ; Returns all sections in the entire WIN.INI file
  5769.         sections = IniItemize("")
  5770.  
  5771.  
  5772.        See Also:
  5773.           IniDelete, IniItemizePvt, IniRead, IniWrite
  5774.  
  5775.  
  5776.  
  5777.  
  5778.        IniItemizePvt
  5779.        Lists keywords or sections in a private INI file.
  5780.  
  5781.  
  5782.        Syntax:
  5783.         IniItemizePvt (section, filename)
  5784.  
  5785.        Parameters:
  5786.         (s) section  the major heading to itemize.
  5787.         (s) filename name of the INI file.
  5788.  
  5789.        Returns:
  5790.         (s)          list of keywords or sections.
  5791.  
  5792.        IniItemizePvt will scan the specified section in a private INI file,
  5793.        and return a tab-delimited list of all keyword names contained within
  5794.        that section.  If a null string ("") is given as the section name,
  5795.        IniItemizePvt will return a list of all section names contained within
  5796.  
  5797.  
  5798.  
  5799.  
  5800.  
  5801.        the file.  Returns "(None)" if the specified section does not exist;
  5802.        returns a null string ("") if the section exists but is empty.  Case
  5803.        is not significant in section names.
  5804.  
  5805.  
  5806.        Example:
  5807.         ; Returns all keywords in the [Boot] section of SYSTEM.INI
  5808.         keywords = IniItemizePvt("Boot", "system.ini")
  5809.  
  5810.  
  5811.        See Also:
  5812.           IniDeletePvt, IniItemize, IniReadPvt, IniWritePvt
  5813.  
  5814.  
  5815.  
  5816.  
  5817.        IniRead
  5818.        Reads data from the WIN.INI file.
  5819.  
  5820.  
  5821.        Syntax:
  5822.         IniRead (section, keyname, default)
  5823.  
  5824.        Parameters:
  5825.         (s) section  the major heading to read the data from.
  5826.         (s) keyname  the name of the item to read.
  5827.         (s) default  string to return if the desired item is not found.
  5828.  
  5829.        Returns:
  5830.         (s)          data from WIN.INI file.
  5831.  
  5832.        This function allows a program to read data from the WIN.INI file.
  5833.  
  5834.        The WIN.INI file has the form:
  5835.  
  5836.           [section]
  5837.           keyname=settings
  5838.  
  5839.  
  5840.        Most of the entries in WIN.INI are set from the Windows Control Panel
  5841.        program, but individual applications can also use it to store option
  5842.        settings in their own sections.
  5843.  
  5844.  
  5845.        Example:
  5846.         ; Find the default output device
  5847.         a = IniRead("windows", "device", "No Default")
  5848.         Message("Default Output Device", a)
  5849.  
  5850.  
  5851.        See Also:
  5852.           Environment, IniDelete, IniItemize, IniReadPvt, IniWrite
  5853.  
  5854.  
  5855.  
  5856.  
  5857.  
  5858.  
  5859.  
  5860.  
  5861.        IniReadPvt
  5862.        Reads data from a private INI file.
  5863.  
  5864.  
  5865.        Syntax:
  5866.         IniReadPvt (section, keyname, default, filename)
  5867.  
  5868.        Parameters:
  5869.         (s) section  the major heading to read the data from.
  5870.         (s) keyname  the name of the item to read.
  5871.         (s) default  string to return if the desired item is not found.
  5872.         (s) filename name of the INI file.
  5873.  
  5874.        Returns:
  5875.         (s)          data from the INI file.
  5876.  
  5877.        Looks up a value in the "filename".INI file.  If the value is not
  5878.        found, the "default" will be returned.
  5879.  
  5880.  
  5881.        Example:
  5882.         IniReadPvt("Main", "Lang", "English", "WB.INI")
  5883.  
  5884.        Given the following segment from WB.INI:
  5885.  
  5886.           [Main]
  5887.           Lang=French
  5888.  
  5889.        The statement above would return:
  5890.  
  5891.           French
  5892.  
  5893.  
  5894.        See Also:
  5895.           Environment, IniDeletePvt, IniItemizePvt, IniRead, IniWritePvt
  5896.  
  5897.  
  5898.  
  5899.  
  5900.        IniWrite
  5901.        Writes data to the WIN.INI file.
  5902.  
  5903.  
  5904.        Syntax:
  5905.         IniWrite (section, keyname, data)
  5906.  
  5907.        Parameters:
  5908.         (s) section  major heading to write the data to.
  5909.         (s) keyname  name of the data item to write.
  5910.         (s) data     string to write to the WIN.INI file.
  5911.  
  5912.        Returns:
  5913.         (i)          always 1.
  5914.  
  5915.  
  5916.  
  5917.  
  5918.  
  5919.        This command allows a program to write data to the WIN.INI file.  The
  5920.        "section" is added to the file if it doesn't already exist.
  5921.  
  5922.  
  5923.        Example:
  5924.         ; Change the list of pgms to load upon Windows
  5925.         ; startup
  5926.         loadprogs = IniRead("windows", "load", "")
  5927.         newprogs = AskLine("Add Pgm To LOAD= Line", "Add:", loadprogs)
  5928.         IniWrite("windows", "load", newprogs)
  5929.  
  5930.  
  5931.        See Also:
  5932.           IniDelete, IniItemize, IniRead, IniWritePvt
  5933.  
  5934.  
  5935.  
  5936.  
  5937.        IniWritePvt
  5938.        Writes data to a private INI file.
  5939.  
  5940.  
  5941.        Syntax:
  5942.         IniWritePvt (section, keyname, data, filename)
  5943.  
  5944.        Parameters:
  5945.         (s) section  major heading to write the data to.
  5946.         (s) keyname  name of the data item to write.
  5947.         (s) data     string to write to the INI file.
  5948.         (s) filename name of the INI file.
  5949.  
  5950.        Returns:
  5951.         (i)          always 1.
  5952.  
  5953.        Writes a value in the "filename".INI file.
  5954.  
  5955.  
  5956.        Example:
  5957.         IniWritePvt("Main", "Lang", "French, "WB.INI")
  5958.  
  5959.        This would create the following entry in WB.INI:
  5960.  
  5961.           [Main]
  5962.           Lang=French
  5963.  
  5964.  
  5965.        See Also:
  5966.           IniDeletePvt, IniItemizePvt, IniReadPvt, IniWrite
  5967.  
  5968.  
  5969.  
  5970.  
  5971.        IntControl
  5972.        Internal control functions.
  5973.  
  5974.  
  5975.  
  5976.  
  5977.  
  5978.  
  5979.        Syntax:
  5980.         IntControl (request#, p1, p2, p3, p4)
  5981.  
  5982.        Parameters:
  5983.         (i) request# specifies which sub-function is to be performed (see
  5984.                      below).
  5985.         (s) p1 - p4  parameters which may be required by the function (see
  5986.                      below).
  5987.  
  5988.        Returns:
  5989.         (s)          varies (see below).
  5990.  
  5991.        Short for Internal Control, a special function that permits numerous
  5992.        internal operations in the various products.  The first parameter of
  5993.        IntControl defines exactly what the function does, the other
  5994.        parameters are possible arguments to the function.
  5995.  
  5996.        Refer to your product documentation for any further information on
  5997.        this function.
  5998.  
  5999.        Warning: Many of these operations are useful only under special
  6000.        circumstances, and/or by technically knowledgeable users.  Some could
  6001.        lead to adverse side effects.  If it isn't clear to you what a
  6002.        particular function does, don't use it.
  6003.  
  6004.  
  6005.        IntControl (1, p1, 0, 0, 0)
  6006.        Just a test IntControl.  It echoes back P1 & P2 and P3 & P4 in a pair
  6007.        of message boxes.
  6008.  
  6009.  
  6010.        IntControl (4, p1, 0, 0, 0)
  6011.        Controls whether or not a dialog box with a file listbox in it has to
  6012.        return a file name, or may return merely a directory name or nothing.
  6013.  
  6014.           P1   Meaning
  6015.  
  6016.           0    May return nothing, or just a directory name
  6017.           1    Must return a file name (default)
  6018.  
  6019.  
  6020.        IntControl (5, p1, 0, 0, 0)
  6021.        Controls whether system & hidden files are seen and processed.
  6022.  
  6023.           P1   Meaning
  6024.  
  6025.           0    System & Hidden files not used (default)
  6026.           1    System & Hidden files seen and used
  6027.  
  6028.  
  6029.        IntControl (10, p1, 0, 0, 0)
  6030.        Interrogates the Command Extender DLL status
  6031.  
  6032.           P1   Meaning
  6033.  
  6034.  
  6035.  
  6036.  
  6037.  
  6038.           0    Command Extender present
  6039.                0     No
  6040.                1     Yes
  6041.  
  6042.           1    Command Extender version
  6043.                -1    No Extender present
  6044.                0     Incompatible extender present
  6045.                (other)Extender version code
  6046.  
  6047.           2    Interpreter's Extender interface code
  6048.  
  6049.           3    Name of Extender DLL
  6050.  
  6051.  
  6052.        IntControl (20, 0, 0, 0, 0)
  6053.        Returns window handle of current parent window.
  6054.  
  6055.  
  6056.        IntControl (21, p1, 0, 0, 0)
  6057.        Returns window handle of window matching the partial window-name in
  6058.        p1.
  6059.  
  6060.  
  6061.        IntControl (22, p1, p2, p3, p4)
  6062.        Issues a Windows "SendMessage".
  6063.  
  6064.           p1   Window handle to send to
  6065.           p2   Message ID number (in decimal)
  6066.           p3   wParam value
  6067.           p4   assumed to be a character string.  String is copied to a 
  6068.                GMEM_LOWER buffer, and a LPSTR to the copied string is passed 
  6069.                as lParam. The GMEM_LOWER buffer is freed immediately upon 
  6070.                return from the SendMessage
  6071.  
  6072.  
  6073.        IntControl (23, 0, 0, 0, 0)
  6074.        Issues a windows PostMessage
  6075.  
  6076.           p1   Window handle
  6077.           p2   Message ID number (in decimal)
  6078.           p3   wParam
  6079.           p4   lParam -- assumed to be numeric
  6080.  
  6081.  
  6082.        IntControl (66, 0, 0, 0, 0)
  6083.        Restarts Windows, just like exiting to DOS and typing WIN again.
  6084.        Could be used to restart Windows after editing the SYSTEM.INI file to
  6085.        change video modes.
  6086.  
  6087.  
  6088.        IntControl (67, 0, 0, 0, 0)
  6089.        Performs a warm boot of the system, just like <Ctrl-Alt-Del>.  Could
  6090.        be used to reboot the system after editing the AUTOEXEC.BAT or
  6091.        CONFIG.SYS files.
  6092.  
  6093.        Note: IntControl(67) requires Windows 3.1 or higher.  Under Windows
  6094.        3.0, it behaves just like IntControl(66) and restarts Windows.
  6095.  
  6096.  
  6097.  
  6098.  
  6099.  
  6100.  
  6101.  
  6102.  
  6103.        IsDefined
  6104.        Determines if a variable name is currently defined.
  6105.  
  6106.  
  6107.        Syntax:
  6108.         IsDefined (var)
  6109.  
  6110.        Parameters:
  6111.         (s) var      a variable name.
  6112.  
  6113.        Returns:
  6114.         (i)          @YES if the variable is currently defined;
  6115.                      @NO if it was never defined or has been dropped.
  6116.  
  6117.        A variable is defined the first time it appears to the left of an
  6118.        equal sign in a statement.  It stays defined until it is explicitly
  6119.        dropped with the Drop function, or until the current invocation of the
  6120.        WIL Interpreter gets closed.
  6121.  
  6122.  
  6123.        Example:
  6124.         def = IsDefined(thisvar)
  6125.         If def == @FALSE Then Message("ERROR!", "Variable not defined")
  6126.  
  6127.  
  6128.        See Also:
  6129.           Drop
  6130.  
  6131.  
  6132.  
  6133.  
  6134.        IsKeyDown
  6135.        Tells about keys/mouse.
  6136.  
  6137.        Syntax:
  6138.         IsKeyDown(keycodes)
  6139.  
  6140.        Parameters:
  6141.         (i) keycodes @SHIFT and/or @CTRL.
  6142.  
  6143.        Returns:
  6144.         (i)          @YES if the key is down;
  6145.                      @NO if the key is not down.
  6146.  
  6147.  
  6148.        Determines if the Shift key or the Ctrl key is currently down.
  6149.  
  6150.        Note: The right mouse button is the same as Shift, and the middle
  6151.        mouse button is the same as Ctrl.
  6152.  
  6153.  
  6154.  
  6155.  
  6156.  
  6157.  
  6158.        Examples:
  6159.         IsKeyDown(@SHIFT)
  6160.  
  6161.         IsKeyDown(@CTRL)
  6162.  
  6163.         IsKeyDown(@CTRL | @SHIFT)
  6164.  
  6165.         IsKeyDown(@CTRL & @SHIFT)
  6166.  
  6167.  
  6168.        See Also:
  6169.           WaitForKey
  6170.  
  6171.  
  6172.  
  6173.  
  6174.        IsLicensed
  6175.        Tells if the calling application is licensed.
  6176.  
  6177.  
  6178.        Syntax:
  6179.         IsLicensed ( )
  6180.  
  6181.        Parameters:
  6182.         (none)
  6183.  
  6184.        Returns:
  6185.         (i)          @YES if it is licensed;
  6186.                      @NO if it is not licensed.
  6187.  
  6188.  
  6189.        Returns information on whether or not the currently-running version of
  6190.        the calling application is a licensed copy.
  6191.  
  6192.  
  6193.        Example:
  6194.         IsLicensed()
  6195.  
  6196.  
  6197.        See Also:
  6198.           Version
  6199.  
  6200.  
  6201.  
  6202.  
  6203.        IsMenuChecked [*M]
  6204.        Determines if a menu item has a checkmark next to it.
  6205.  
  6206.  
  6207.        Syntax:
  6208.         IsMenuChecked (menuname)
  6209.  
  6210.        Parameters:
  6211.         (s) menuname name of the menu item to test.
  6212.  
  6213.  
  6214.  
  6215.  
  6216.  
  6217.  
  6218.        Returns:
  6219.         (i)          @YES if the menu item has a checkmark;
  6220.                      @NO if it doesn't.
  6221.  
  6222.        You can place a checkmark next to a menu item with the MenuChange
  6223.        command, to indicate an option has been enabled.  This function lets
  6224.        you determine if the menu item has already been checked or not.
  6225.  
  6226.        Note: This command is not part of the WIL Interpreter package, but is
  6227.        documented here because it has been implemented in many of the shell
  6228.        or file manager-type applications which use the WIL Interpreter.
  6229.  
  6230.  
  6231.        Example:
  6232.         ; assume we've defined a "Misc | Prompt Often" menu item
  6233.         prompt = IsMenuChecked("MiscPromptOften")
  6234.         ifprompt = SubStr(";", 1, (prompt == @FALSE))
  6235.         Execute %ifprompt% confirm = AskYesNo("???", "REALLY do this?")
  6236.         ; some risky operation the user has just confirmed they want to do
  6237.         Execute %ifprompt% Terminate(confirm != @YES, "", "")
  6238.  
  6239.  
  6240.        See Also:
  6241.           IsMenuEnabled, MenuChange
  6242.  
  6243.  
  6244.  
  6245.  
  6246.        IsMenuEnabled [*M]
  6247.        Determines if a menu item has been enabled.
  6248.  
  6249.  
  6250.        Syntax:
  6251.         IsMenuEnabled (menuname)
  6252.  
  6253.        Parameters:
  6254.         (s) menuname name of the menu item to test.
  6255.  
  6256.        Returns:
  6257.         (i)          @YES if the menu item is enabled;
  6258.                      @NO if it is disabled & grayed.
  6259.  
  6260.        You can disable a menu item with the MenuChange command if you want to
  6261.        prevent the user from choosing it.  It shows up on the screen as a
  6262.        grayed item.  IsMenuEnabled lets you determine if the menu item is
  6263.        currently enabled or not.
  6264.  
  6265.        Note: This command is not part of the WIL Interpreter package, but is
  6266.        documented here because it has been implemented in many of the shell
  6267.        or file manager-type applications which use the WIL Interpreter.
  6268.  
  6269.  
  6270.        Example:
  6271.         ; allow editing of autoexec.bat file only if choice enabled
  6272.         Terminate(!IsMenuEnabled("UtilitiesEditBatFile"), "", "")
  6273.         Run("notepad.exe", "c:\autoexec.bat")
  6274.  
  6275.  
  6276.  
  6277.  
  6278.  
  6279.  
  6280.  
  6281.        See Also:
  6282.           IsMenuChecked, MenuChange
  6283.  
  6284.  
  6285.  
  6286.  
  6287.        IsNumber
  6288.        Determines whether a variable contains a valid number.
  6289.  
  6290.  
  6291.        Syntax:
  6292.         IsNumber (string)
  6293.  
  6294.        Parameters:
  6295.         (s) string   string to test to see if it represents a valid number.
  6296.  
  6297.        Returns:
  6298.         (i)          @YES if it contains a valid number;
  6299.                      @NO if it doesn't.
  6300.  
  6301.        This function determines if a string variable contains a valid
  6302.        integer.  Useful for checking user input prior to using it in
  6303.        computations.
  6304.  
  6305.  
  6306.        Example:
  6307.         a = AskLine("ISNUMBER", "Enter a number", "0")
  6308.         If IsNumber(a) == @NO Then Message("", "You didn't enter a 
  6309.             number")
  6310.  
  6311.  
  6312.        See Also:
  6313.           Abs, Char2Num, Num2Char
  6314.  
  6315.  
  6316.  
  6317.  
  6318.        ItemCount
  6319.        Returns the number of items in a list.
  6320.  
  6321.  
  6322.        Syntax:
  6323.         ItemCount (list, delimiter)
  6324.  
  6325.        Parameters:
  6326.         (s) list     a string containing a list of items.
  6327.         (s) delimiter a character to act as a delimiter between items in the
  6328.                      list.
  6329.  
  6330.        Returns:
  6331.         (i)          the number of items in the list.
  6332.  
  6333.        If you create the list with the FileItemize or DirItemize functions
  6334.        you will be using a space-delimited list.  WinItemize, however,
  6335.  
  6336.  
  6337.  
  6338.  
  6339.  
  6340.        creates a tab-delimited list of window titles since titles can have
  6341.        embedded blanks.
  6342.  
  6343.  
  6344.        Example:
  6345.         a = FileItemize("*.*")
  6346.         n = ItemCount(a, " ")
  6347.         Message("Note", "There are %n% files")
  6348.  
  6349.  
  6350.        See Also:
  6351.           ItemExtract, ItemSelect
  6352.  
  6353.  
  6354.  
  6355.  
  6356.        ItemExtract
  6357.        Returns the selected item from a list.
  6358.  
  6359.  
  6360.        Syntax:
  6361.         ItemExtract (index, list, delimiter)
  6362.  
  6363.        Parameters:
  6364.         (i) index    the position in list of the item to be selected.
  6365.         (s) list     a string containing a list of items.
  6366.         (s) delimiter a character to act as a delimiter between items in the
  6367.                      list.
  6368.  
  6369.        Returns:
  6370.         (s)          the selected item.
  6371.  
  6372.        If you create the list with the FileItemize or DirItemize functions
  6373.        you will be using a space-delimited list.  WinItemize, however,
  6374.        creates a tab-delimited list of window titles since titles can have
  6375.        embedded blanks.
  6376.  
  6377.  
  6378.        Example:
  6379.         bmpfiles = FileItemize("*.bmp")
  6380.         bmpcount = ItemCount(bmpfiles, " ")
  6381.         pos = (Random(bmpcount - 1)) + 1
  6382.         paper = ItemExtract(pos, bmpfiles, " ")
  6383.         Wallpaper(paper, @FALSE)
  6384.  
  6385.  
  6386.        See Also:
  6387.           ItemCount, ItemLocate, ItemSelect, ItemSort
  6388.  
  6389.  
  6390.  
  6391.  
  6392.        ItemInsert
  6393.        Adds an item to a list.
  6394.  
  6395.  
  6396.  
  6397.  
  6398.  
  6399.  
  6400.        Syntax:
  6401.         ItemInsert (item, index, list, delimiter)
  6402.  
  6403.        Parameters:
  6404.         (s) item     a new item to add to list.
  6405.         (i) index    the position in list after which the item will be
  6406.                      inserted.
  6407.         (s) list     a string containing a list of items.
  6408.         (s) delimiter a character to act as a delimiter between items in the
  6409.                      list.
  6410.  
  6411.        Returns:
  6412.         (s)          new list, with item inserted.
  6413.  
  6414.        This function inserts a new item into an existing list, at the
  6415.        position following index.  It returns a new list, with the specified
  6416.        item inserted; the original list (list) is unchanged.  For example,
  6417.        specifying an index of 1 causes the new item to be inserted after the
  6418.        first item in the list; i.e., the new item becomes the second item in
  6419.        the list.
  6420.  
  6421.        You can specify an index of 0 to add the item to the beginning of the
  6422.        list, and an index of -1 to append the item to the end of the list.
  6423.  
  6424.        If you create the list with the FileItemize or DirItemize functions
  6425.        you will be using a space-delimited list.  WinItemize, however,
  6426.        creates a tab-delimited list of window titles since titles can have
  6427.        embedded blanks.
  6428.  
  6429.  
  6430.        Example:
  6431.         newlist = ItemInsert(item, index, list, delimiter)
  6432.  
  6433.  
  6434.        See Also:
  6435.           ItemCount, ItemRemove
  6436.  
  6437.  
  6438.  
  6439.  
  6440.        ItemLocate
  6441.        Returns the position of an item in a list.
  6442.  
  6443.  
  6444.        Syntax:
  6445.         ItemLocate (item, list, delimiter)
  6446.  
  6447.        Parameters:
  6448.         (s) item     item to search for in list.
  6449.         (s) list     a string containing a list of items.
  6450.         (s) delimiter a character to act as a delimiter between items in the
  6451.                      list.
  6452.  
  6453.        Returns:
  6454.         (i)          position in list of item, or 0 if no match found.
  6455.  
  6456.  
  6457.  
  6458.  
  6459.  
  6460.        This function finds the first occurrence of item in the specified
  6461.        list, and returns the position of the item (the first item in a list
  6462.        has a position of 1).  If the item is not found, the function will
  6463.        return a 0.
  6464.  
  6465.        If you create the list with the FileItemize or DirItemize functions
  6466.        you will be using a space-delimited list.  WinItemize, however,
  6467.        creates a tab-delimited list of window titles since titles can have
  6468.        embedded blanks.
  6469.  
  6470.  
  6471.        Example:
  6472.         ItemLocate(item, list, delimiter)
  6473.  
  6474.  
  6475.        See Also:
  6476.           ItemExtract
  6477.  
  6478.  
  6479.  
  6480.  
  6481.        ItemRemove
  6482.        Removes an item from a list.
  6483.  
  6484.  
  6485.        Syntax:
  6486.         ItemRemove (index, list, delimiter)
  6487.  
  6488.        Parameters:
  6489.         (i) index    the position in list of the item to be removed.
  6490.         (s) list     a string containing a list of items.
  6491.         (s) delimiter a character to act as a delimiter between items in the
  6492.                      list.
  6493.  
  6494.        Returns:
  6495.         (s)          new list, with item removed.
  6496.  
  6497.        This function removes the item at the position specified by index from
  6498.        a list.  The delimiter following the item is removed as well.  It
  6499.        returns a new list, with the specified item removed; the original list
  6500.        (list) is unchanged.
  6501.  
  6502.        If you create the list with the FileItemize or DirItemize functions
  6503.        you will be using a space-delimited list.  WinItemize, however,
  6504.        creates a tab-delimited list of window titles since titles can have
  6505.        embedded blanks.
  6506.  
  6507.  
  6508.        Example:
  6509.         newlist = ItemRemove(index, list, delimiter)
  6510.  
  6511.  
  6512.        See Also:
  6513.           ItemCount, ItemInsert
  6514.  
  6515.  
  6516.  
  6517.  
  6518.  
  6519.  
  6520.  
  6521.  
  6522.        ItemSelect
  6523.        Allows the user to choose an item from a listbox.
  6524.  
  6525.  
  6526.        Syntax:
  6527.         ItemSelect (title, list, delimiter)
  6528.  
  6529.        Parameters:
  6530.         (s) title    the title of the dialog box to display.
  6531.         (s) list     a string containing a list of items.
  6532.         (s) delimiter a character to act as a delimiter between items in the
  6533.                      list.
  6534.  
  6535.        Returns:
  6536.         (s)          the selected item.
  6537.  
  6538.        This function displays a dialog box with a listbox inside.  This
  6539.        listbox is filled with a sorted list of items taken from a string you
  6540.        provide to the function.
  6541.  
  6542.        Each item in the string must be separated ("delimited") by a
  6543.        character, which you also pass to the function.
  6544.  
  6545.        The user selects one of the items by either doubleclicking on it, or
  6546.        single-clicking and pressing OK.  The item is returned as a string.
  6547.  
  6548.        If you create the list with the FileItemize or DirItemize functions
  6549.        you will be using a space-delimited list.  WinItemize, however,
  6550.        creates a tab-delimited list of window titles since titles can have
  6551.        embedded blanks.
  6552.  
  6553.  
  6554.        Example:
  6555.         DirChange("c:\winword")
  6556.         alldotfiles = FileItemize("*.dot")
  6557.         dotfile = ItemSelect("W4W Templates", alldotfiles, " ")
  6558.         Run("winword.exe", dotfile)
  6559.  
  6560.        Which would produce:
  6561.  
  6562.  
  6563.  
  6564.  
  6565.  
  6566.  
  6567.  
  6568.  
  6569.  
  6570.  
  6571.  
  6572.  
  6573.  
  6574.  
  6575.  
  6576.  
  6577.  
  6578.  
  6579.  
  6580.  
  6581.  
  6582.  
  6583.        See Also:
  6584.           AskYesNo, DialogBox, DirItemize, Display, FileItemize, ItemCount,
  6585.           ItemExtract, Message, Pause, TextBox, TextSelect, WinItemize
  6586.  
  6587.  
  6588.  
  6589.  
  6590.        ItemSort
  6591.        Sorts a list.
  6592.  
  6593.  
  6594.        Syntax:
  6595.         ItemSort (list, delimiter)
  6596.  
  6597.        Parameters:
  6598.         (s) list     a string containing a list of items.
  6599.         (s) delimiter a character to act as a delimiter between items in the
  6600.                      list.
  6601.  
  6602.        Returns:
  6603.         (s)          new, sorted list.
  6604.  
  6605.        This function sorts a list, using an ANSI sort sequence.  It returns a
  6606.        new, sorted list; the original list is unchanged.
  6607.  
  6608.        If you create the list with the FileItemize or DirItemize functions
  6609.        you will be using a space-delimited list.  WinItemize, however,
  6610.        creates a tab-delimited list of window titles since titles can have
  6611.        embedded blanks.
  6612.  
  6613.  
  6614.        Example:
  6615.         newlist = ItemSort(list, delimiter)
  6616.  
  6617.  
  6618.        See Also:
  6619.           ItemExtract
  6620.  
  6621.  
  6622.  
  6623.  
  6624.  
  6625.  
  6626.  
  6627.  
  6628.        LastError
  6629.        Returns the most-recent error encountered during the current WIL
  6630.        program.
  6631.  
  6632.  
  6633.        Syntax:
  6634.         LastError ( )
  6635.  
  6636.        Parameters:
  6637.         (none)
  6638.  
  6639.        Returns:
  6640.         (i)          most-recent WIL error code encountered.
  6641.  
  6642.        WIL errors are numbered according to their severity.  "Minor" errors
  6643.        go from 1000 through 1999.  Moderate errors are 2000 through 2999.
  6644.        Fatal errors are numbered 3000 to 3999.
  6645.  
  6646.        Depending on which error mode is active when an error occurs, you may
  6647.        not get a chance to check the error code.  See ErrorMode for a
  6648.        discussion of default error handling.
  6649.  
  6650.        Don't bother checking for "fatal" error codes.  When a fatal error
  6651.        occurs, the WIL program is canceled before the next WIL statement gets
  6652.        to execute (regardless of which error mode is active).
  6653.  
  6654.        Every time the LastError function is called, the "last error"
  6655.        indicator is reset to zero.
  6656.  
  6657.        A full listing of possible errors you can encounter in processing a
  6658.        WIL program is in Appendix B (pg. 191).
  6659.  
  6660.  
  6661.        Example:
  6662.         ErrorMode(@OFF)
  6663.         FileCopy("data.dat", "c:\backups", @FALSE)
  6664.         ErrorMode(@CANCEL)
  6665.         If LastError() == 1006 Then Message("Error", "Please call  Tech
  6666.         Support at 555-9999.")
  6667.  
  6668.  
  6669.        See Also:
  6670.           Debug, ErrorMode
  6671.  
  6672.  
  6673.  
  6674.  
  6675.        LogDisk
  6676.        Logs (activates) a disk drive.
  6677.  
  6678.  
  6679.        Syntax:
  6680.         LogDisk (drive-letter)
  6681.  
  6682.  
  6683.  
  6684.  
  6685.  
  6686.  
  6687.        Parameters:
  6688.         (s) drive-letter   the disk drive to log into.
  6689.  
  6690.        Returns:
  6691.         (i)          @TRUE if the current drive was changed;
  6692.                      @FALSE if the drive doesn't exist.
  6693.  
  6694.        Use this function to change to a different disk drive.
  6695.  
  6696.  
  6697.        Example:
  6698.         LogDisk("c:")
  6699.  
  6700.  
  6701.        See Also:
  6702.           DirChange, DiskScan
  6703.  
  6704.  
  6705.  
  6706.  
  6707.        Max
  6708.        Returns largest number in a list of numbers.
  6709.  
  6710.  
  6711.        Syntax:
  6712.         Max (integer [, integer...])
  6713.  
  6714.        Parameters:
  6715.         (i) integer  an integer number.
  6716.  
  6717.        Returns:
  6718.         (i)          largest parameter.
  6719.  
  6720.        Use this function to determine the largest of a set of comma-delimited
  6721.        integers.
  6722.  
  6723.  
  6724.        Example:
  6725.         a = Max(5, -37, 125, 34, 2345, -32767)
  6726.         Message("Largest number is", a)
  6727.  
  6728.  
  6729.        See Also:
  6730.           Abs, Average, Min, Random
  6731.  
  6732.  
  6733.  
  6734.  
  6735.        MenuChange [*M]
  6736.        Checks, unchecks, enables, or disables a menu item.
  6737.  
  6738.  
  6739.        Syntax:
  6740.         MenuChange (menuname, flags)
  6741.  
  6742.  
  6743.  
  6744.  
  6745.  
  6746.  
  6747.        Parameters:
  6748.         (s) menuname menu item whose status you wish to change.
  6749.         (s) flags    @CHECK, @UNCHECK, @ENABLE, or @DISABLE.
  6750.  
  6751.        Returns:
  6752.         (i)          always 1.
  6753.  
  6754.        There are currently two ways you can modify a menu item:
  6755.  
  6756.        You can check and uncheck the item to imply that it corresponds to an
  6757.        option that can be turned on or off.
  6758.  
  6759.        You can temporarily disable the item (it shows up as gray) and later
  6760.        re-enable it.
  6761.  
  6762.        The two sets of flags (@Check/@UnCheck and @Enable/@Disable) can be
  6763.        combined in one function call by using the | (or) operator.
  6764.  
  6765.        Note: This command is not part of the WIL Interpreter package, but is
  6766.        documented here because it has been implemented in many of the shell
  6767.        or file manager-type applications which use the WIL Interpreter.
  6768.  
  6769.  
  6770.        Example:
  6771.         MenuChange("FilePrint", @Disable)
  6772.         MenuChange("WPWrite", @Enable | @Check)
  6773.  
  6774.  
  6775.        See Also:
  6776.           IsMenuChecked, IsMenuEnabled
  6777.  
  6778.  
  6779.  
  6780.  
  6781.        Message
  6782.        Displays a message to the user.
  6783.  
  6784.  
  6785.        Syntax:
  6786.         Message (title, text)
  6787.  
  6788.        Parameters:
  6789.         (s) title    title of the message box.
  6790.         (s) text     text to display in the message box.
  6791.  
  6792.        Returns:
  6793.         (i)          always 1.
  6794.  
  6795.        Use this function to display a message to the user.  The user must
  6796.        respond by selecting the OK button before processing will continue.
  6797.  
  6798.  
  6799.        Example:
  6800.         Message("Current directory is", DirGet())
  6801.  
  6802.        which produces:
  6803.  
  6804.  
  6805.  
  6806.  
  6807.  
  6808.  
  6809.  
  6810.  
  6811.  
  6812.  
  6813.  
  6814.  
  6815.  
  6816.        See Also:
  6817.           Display, Pause
  6818.  
  6819.  
  6820.  
  6821.  
  6822.        Min
  6823.        Returns lowest number in a list of numbers.
  6824.  
  6825.  
  6826.        Syntax:
  6827.         Min (integer [, integer...])
  6828.  
  6829.        Parameters:
  6830.         (i) integer  an integer number.
  6831.  
  6832.        Returns:
  6833.         (i)          lowest parameter.
  6834.  
  6835.        Use this function to determine the lowest of a set of comma-delimited
  6836.        integers.
  6837.  
  6838.  
  6839.        Example:
  6840.         a = Min( 5, -37, 125, 34, 2345, -32767)
  6841.         Message("Smallest number is", a)
  6842.  
  6843.  
  6844.        See Also:
  6845.           Abs, Average, Max, Random
  6846.  
  6847.  
  6848.  
  6849.  
  6850.        MouseInfo
  6851.        Returns assorted mouse information.
  6852.  
  6853.  
  6854.        Syntax:
  6855.         MouseInfo (request#)
  6856.  
  6857.        Parameters:
  6858.         (i) request# see below.
  6859.  
  6860.        Returns:
  6861.         (s)          see below.
  6862.  
  6863.        The information returned by MouseInfo depends on the value of
  6864.        request#.
  6865.  
  6866.  
  6867.  
  6868.  
  6869.  
  6870.           Req# Return value
  6871.  
  6872.           0    Window name under mouse
  6873.           1    Top level parent window name under mouse
  6874.           2    Mouse coordinates, assuming a 1000x1000 virtual screen
  6875.           3    Mouse coordinates in absolute numbers
  6876.           4    Status of mouse buttons, as a bitmask:
  6877.  
  6878.                  BinaryDecimal  Meaning
  6879.  
  6880.                  000   0      No buttons down
  6881.                  001   1      Right button down
  6882.                  010   2      Middle button down
  6883.                  011   3      Right and Middle buttons down
  6884.                  100   4      Left button down
  6885.                  101   5      Left and Right buttons down
  6886.                  110   6      Left and Middle buttons down
  6887.                  111   7      Left, Middle, and Right buttons down
  6888.  
  6889.        For example, if mouse is at the center of a 640x480 screen and above
  6890.        the "Clock" window, and the left button is down, the following values
  6891.        would be returned:
  6892.  
  6893.           Req# Return value
  6894.  
  6895.           1    "Clock"
  6896.           2    "500 500"
  6897.           3    "320 240"
  6898.           4    "4"
  6899.  
  6900.  
  6901.        Example:
  6902.         Display(1, "", "Press a mouse button to continue")
  6903.         :loop
  6904.         buttons = MouseInfo(4)
  6905.         If buttons == 0 Then Goto loop
  6906.         If buttons & 4 Then Display(1, "", "Left button was pressed")
  6907.         If buttons & 1 Then Display(1, "", "Right button was pressed")
  6908.  
  6909.  
  6910.        See Also:
  6911.           WinMetrics, WinParmGet
  6912.  
  6913.  
  6914.  
  6915.  
  6916.        NetAddCon
  6917.        Connects network resources to imaginary local disk drives or printer
  6918.        ports.
  6919.  
  6920.  
  6921.        Syntax:
  6922.         NetAddCon (net-path, password, local-name)
  6923.  
  6924.        Parameters:
  6925.         (s) net-path net resource or string returned by NetBrowse.
  6926.         (s) password password required to access resource, or "".
  6927.  
  6928.  
  6929.  
  6930.  
  6931.  
  6932.         (s) local-name     local drive name or printer port.
  6933.  
  6934.        Returns:
  6935.         (i)          @TRUE if successful; @FALSE if unsuccessful.
  6936.  
  6937.        You can use NetAddCon to connect a local drive to a network directory,
  6938.        in which case "local-name" will be a drive name (eg, "Z:").  You can
  6939.        also connect a local printer port to a network print queue, in which
  6940.        case "local-name" will be the name of the printer port (eg, "LPT1").
  6941.  
  6942.        Use the NetBrowse function to obtain a value for "net-path".
  6943.  
  6944.        If no password is required, use a null string ("") for the "password"
  6945.        parameter.
  6946.  
  6947.  
  6948.        Example:
  6949.         availdrive = DiskScan(0)
  6950.         drvlen = StrLen(availdrive)
  6951.         If drvlen == 0 Then Goto nomore
  6952.         availdrive = StrSub(availdrive, drvlen - 2, 2)
  6953.         netpath = NetBrowse(0)
  6954.         pwd = AskPassword("Enter password for", netpath)
  6955.         NetAddCon(netpath, pwd, availdrive)
  6956.         Exit
  6957.         :nomore
  6958.         Message("Connect Drive to Net", "No drives avail for assignment")
  6959.  
  6960.  
  6961.        See Also:
  6962.           NetAttach, NetBrowse, NetCancelCon, NetGetCon, NetMapRoot
  6963.  
  6964.  
  6965.  
  6966.  
  6967.        NetAttach
  6968.        Attaches to a network file server.
  6969.  
  6970.  
  6971.        Syntax:
  6972.         NetAttach (server-name)
  6973.  
  6974.        Parameters:
  6975.         (s) server-name    name of the network file server.
  6976.  
  6977.        Returns:
  6978.         (i)          @TRUE if successful; @FALSE if unsuccessful.
  6979.  
  6980.        This function may not work with all networks.
  6981.  
  6982.  
  6983.        Example:
  6984.         NetAttach("userapps")
  6985.  
  6986.  
  6987.        See Also:
  6988.           NetAddCon, NetDetach, NetLogin
  6989.  
  6990.  
  6991.  
  6992.  
  6993.  
  6994.  
  6995.  
  6996.  
  6997.        NetBrowse
  6998.        Displays a network dialog box allowing the user to select a network
  6999.        resource.
  7000.  
  7001.  
  7002.        Syntax:
  7003.         NetBrowse (request#)
  7004.  
  7005.        Parameters:
  7006.         (i) request# see below.
  7007.  
  7008.        Returns:
  7009.         (s)          see below.
  7010.  
  7011.        Specifying a request# of 0 allows selection of a network directory,
  7012.        and specifying a request# of 1 allows selection of a network print
  7013.        queue.  This function returns a string that can be used by NetAddCon
  7014.        to add a connection.
  7015.  
  7016.  
  7017.        Example:
  7018.         availdrive = DiskScan(0)
  7019.         drvlen = StrLen(availdrive)
  7020.         If drvlen == 0 Then Goto nomore
  7021.         availdrive = StrSub(availdrive, drvlen - 2, 2)
  7022.         netpath = NetBrowse(0)
  7023.         pswd = AskPassword("Enter password for", netpath)
  7024.         NetAddCon(netpath, pswd, availdrive)
  7025.         Exit
  7026.         :nomore
  7027.         Message("Connect Drive to Net", "No drives avail for assignment")
  7028.  
  7029.  
  7030.        See Also:
  7031.           NetAddCon, NetMapRoot
  7032.  
  7033.  
  7034.  
  7035.  
  7036.        NetCancelCon
  7037.        Breaks a network connection.
  7038.  
  7039.  
  7040.        Syntax:
  7041.         NetCancelCon (name, force)
  7042.  
  7043.        Parameters:
  7044.         (s) name     network resource name or local name.
  7045.         (i) force    force flag (see below).
  7046.  
  7047.        Returns:
  7048.         (i)          @TRUE if successful; @FALSE if unsuccessful.
  7049.  
  7050.  
  7051.  
  7052.  
  7053.  
  7054.        If force is set to 0, NetCancelCon will not break the connection if
  7055.        any files on that connection are still open.  If force is set to 1,
  7056.        the connection will be broken regardless.
  7057.  
  7058.  
  7059.        Example:
  7060.         availdrive = DiskScan(4)
  7061.         n = ItemCount(availdrive, " ")
  7062.         If n == 0 Then Exit
  7063.         i = 1
  7064.         dislist = ""
  7065.         :loop
  7066.         drv = ItemExtract(i, availdrive, " ")
  7067.         dislist = StrCat(drv, Num2Char(9), NetGetCon(drv), "|")
  7068.         i = i + 1
  7069.         If i < n Then Goto loop
  7070.         availdrive = ItemSelect("Disconnect", dislist, "|")
  7071.         NetCancelCon(availdrive, 0)
  7072.  
  7073.  
  7074.        See Also:
  7075.           NetAddCon, NetDetach, NetGetCon
  7076.  
  7077.  
  7078.  
  7079.  
  7080.        NetDetach
  7081.        Detaches from a network file server.
  7082.  
  7083.  
  7084.        Syntax:
  7085.         NetDetach (server-name)
  7086.  
  7087.        Parameters:
  7088.         (s) server-name    name of the network file server.
  7089.  
  7090.        Returns:
  7091.         (i)          @TRUE if successful; @FALSE if unsuccessful.
  7092.  
  7093.        This function may not work with all networks.
  7094.  
  7095.  
  7096.        Example:
  7097.         NetDetach("userapps")
  7098.  
  7099.  
  7100.        See Also:
  7101.           NetAttach, NetCancelCon
  7102.  
  7103.  
  7104.  
  7105.  
  7106.        NetDialog
  7107.        Brings up the network driver's dialog box.
  7108.  
  7109.  
  7110.  
  7111.  
  7112.  
  7113.  
  7114.        Syntax:
  7115.         NetDialog ( )
  7116.  
  7117.        Parameters:
  7118.         (none)
  7119.  
  7120.        Returns:
  7121.         (i)          @TRUE if successful; @FALSE if unsuccessful.
  7122.  
  7123.        A network driver's dialog box displays copyright information, and may
  7124.        allow access to the network, depending on the particular network
  7125.        driver.  The WIL program will wait until the network dialog terminates
  7126.        before continuing.
  7127.  
  7128.  
  7129.        Example:
  7130.         NetDialog()
  7131.  
  7132.  
  7133.  
  7134.        NetGetCaps
  7135.        Returns information on network capabilities.
  7136.  
  7137.  
  7138.        Syntax:
  7139.         NetGetCaps (request#)
  7140.  
  7141.        Parameters:
  7142.         (i) request# see below.
  7143.  
  7144.        Returns:
  7145.         (i)          see below.
  7146.  
  7147.        NetGetCaps returns 0 if no network is installed (it is the only
  7148.        network function you can use without having a network installed and
  7149.        not get an error).
  7150.  
  7151.           Req# Return value
  7152.  
  7153.           1    Network driver specification number
  7154.  
  7155.           2    Type of network installed:
  7156.                0    None
  7157.                256  MS Network
  7158.                512  Lan Manager
  7159.                768  Novell NetWare
  7160.                1024 Banyan Vines
  7161.                1280 10 Net
  7162.                (other)Other network
  7163.  
  7164.           3    Network driver version number
  7165.  
  7166.           4    Returns 1 if any network is installed
  7167.  
  7168.           6    Bitmask indicating whether the network driver supports the
  7169.           following
  7170.  
  7171.  
  7172.  
  7173.  
  7174.  
  7175.                connect functions:
  7176.                1    AddConnection
  7177.                2    CancelConnection
  7178.                4    GetConnection
  7179.                8    AutoConnect via DOS
  7180.                16   BrowseDialog
  7181.  
  7182.           7    Bitmask indicating whether the network driver supports the
  7183.           following
  7184.                print functions:
  7185.                2    Open Print Job
  7186.                4    Close Print Job
  7187.                16   Hold Print Job
  7188.                32   Release Print Job
  7189.                64   Cancel Print Job
  7190.                128  Set number of copies
  7191.                256  Watch Print Queue
  7192.                512  Unwatch Print Queue
  7193.                1024 Lock Queue Data
  7194.                2048 Unlock Queue Data
  7195.                4096 Driver will send QueueChanged messages to Print Manager
  7196.                8192 Abort Print Job
  7197.  
  7198.  
  7199.        Example:
  7200.         caps = NetGetCaps(6)
  7201.         If caps & 16 Then Message("", "Your network supports BrowseDialog")
  7202.  
  7203.        See Also:
  7204.           NetGetUser, WinConfig, WinMetrics, WinParmGet
  7205.  
  7206.  
  7207.  
  7208.  
  7209.        NetGetCon
  7210.        Returns the name of a connected network resource.
  7211.  
  7212.  
  7213.        Syntax:
  7214.         NetGetCon (local-name)
  7215.  
  7216.        Parameters:
  7217.         (s) local-name     local drive name or printer port.
  7218.  
  7219.        Returns:
  7220.         (s)          name of network resource.
  7221.  
  7222.        NetGetCon returns the name of the network resource currently connected
  7223.        to "local-name".
  7224.  
  7225.  
  7226.        Example:
  7227.         local = AskLine("NetGetCon", "Enter local drive name", "")
  7228.         If local == "" Then Exit
  7229.         resource = NetGetCon(local)
  7230.         Message("NetGetCon", "%local% is connected to %resource%")
  7231.  
  7232.  
  7233.  
  7234.  
  7235.  
  7236.  
  7237.        See Also:
  7238.           NetAddCon, NetCancelCon
  7239.  
  7240.  
  7241.  
  7242.  
  7243.        NetGetUser
  7244.        Returns the name of the user currently logged into the network.
  7245.  
  7246.  
  7247.        Syntax:
  7248.         NetGetUser ( )
  7249.  
  7250.        Parameters:
  7251.         (none)
  7252.  
  7253.        Returns:
  7254.         (s)          name of current user.
  7255.  
  7256.  
  7257.        Example:
  7258.         IniWritePvt("Current Users", "Excel", NetGetUser(), "usagelog.ini")
  7259.         Run("excel.exe", "")
  7260.  
  7261.  
  7262.        See Also:
  7263.           NetGetCaps
  7264.  
  7265.  
  7266.  
  7267.  
  7268.        NetLogin
  7269.        Performs a network login.
  7270.  
  7271.  
  7272.        Syntax:
  7273.         NetLogin (server-name, user-name, password)
  7274.  
  7275.        Parameters:
  7276.         (s) server-name    name of the network file server.
  7277.         (s) user-name name of the current user.
  7278.         (s) password password required to access server, or "".
  7279.  
  7280.        Returns:
  7281.         (i)          @TRUE if successful; @FALSE if unsuccessful.
  7282.  
  7283.        This function may not work with all networks.
  7284.  
  7285.  
  7286.        Example:
  7287.         pwd = AskPassword("Hello", "Enter password for network access")
  7288.         NetLogin("userapps", "admin1", pwd)
  7289.  
  7290.  
  7291.        See Also:
  7292.           NetAttach, NetLogout
  7293.  
  7294.  
  7295.  
  7296.  
  7297.  
  7298.  
  7299.  
  7300.  
  7301.        NetLogout
  7302.        Performs a network logout.
  7303.  
  7304.  
  7305.        Syntax:
  7306.         NetLogout (server-name)
  7307.  
  7308.        Parameters:
  7309.         (s) server-name    name of the network file server.
  7310.  
  7311.        Returns:
  7312.         (i)          @TRUE if successful; @FALSE if unsuccessful.
  7313.  
  7314.        This function may not work with all networks.
  7315.  
  7316.  
  7317.        Example:
  7318.         NetLogout("userapps")
  7319.  
  7320.  
  7321.        See Also:
  7322.           NetLogin
  7323.  
  7324.  
  7325.  
  7326.  
  7327.        NetMapRoot
  7328.        Maps a local drive to a network resource.
  7329.  
  7330.  
  7331.        Syntax:
  7332.         NetMapRoot (local-name, net-path)
  7333.  
  7334.        Parameters:
  7335.         (s) local-name     local drive name.
  7336.         (s) net-path net resource or string returned by NetBrowse.
  7337.  
  7338.        Returns:
  7339.         (i)          @TRUE if successful; @FALSE if unsuccessful.
  7340.  
  7341.        This function maps a local drive letter as the fake root to a network
  7342.        resource.  This is supported by Novell NetWare, but may not work with
  7343.        any other networks.
  7344.  
  7345.  
  7346.  
  7347.  
  7348.  
  7349.  
  7350.        Example:
  7351.         availdrive = DiskScan(0)
  7352.         drvlen = StrLen(availdrive)
  7353.         If drvlen == 0 Then Goto nomore
  7354.         availdrive = StrSub(availdrive, drvlen - 2, 2)
  7355.         netpath = NetBrowse(0)
  7356.         NetMapRoot(availdrive, netpath)
  7357.         Exit
  7358.         :nomore
  7359.         Message("Connect Drive to Net", "No drives avail for assignment")
  7360.  
  7361.  
  7362.        See Also:
  7363.           NetAddCon, NetBrowse, NetCancelCon
  7364.  
  7365.  
  7366.  
  7367.  
  7368.        NetMemberGet
  7369.        Determines whether the current user is a member of a specific group.
  7370.  
  7371.  
  7372.        Syntax:
  7373.         NetMemberGet (server-name, group-name)
  7374.  
  7375.        Parameters:
  7376.         (s) server-name    name of the network file server.
  7377.         (s) group-name     name of the group.
  7378.  
  7379.        Returns:
  7380.         (i)          @TRUE if successful; @FALSE if unsuccessful.
  7381.  
  7382.        This function may not work with all networks.
  7383.  
  7384.  
  7385.        Example:
  7386.         member = NetMemberGet("userapps", "sales")
  7387.         If member == @YES Then Run("notepad.exe", "dailyrpt.txt")
  7388.  
  7389.  
  7390.        See Also:
  7391.           NetMemberSet
  7392.  
  7393.  
  7394.  
  7395.  
  7396.        NetMemberSet
  7397.        Sets the current user as a member of a group.
  7398.  
  7399.  
  7400.        Syntax:
  7401.         NetMemberSet (server-name, group-name)
  7402.  
  7403.        Parameters:
  7404.         (s) server-name    name of the network file server.
  7405.         (s) group-name     name of the group.
  7406.  
  7407.  
  7408.  
  7409.  
  7410.  
  7411.  
  7412.        Returns:
  7413.         (i)          @TRUE if successful; @FALSE if unsuccessful.
  7414.  
  7415.        This function may not work with all networks.
  7416.  
  7417.  
  7418.        Example:
  7419.         NetMemberSet("userapps", "sales")
  7420.  
  7421.  
  7422.        See Also:
  7423.           NetMemberGet
  7424.  
  7425.  
  7426.  
  7427.  
  7428.        NetMsgAll
  7429.        Broadcasts a message to all users on the network.
  7430.  
  7431.  
  7432.        Syntax:
  7433.         NetMsgAll (server-name, message)
  7434.  
  7435.        Parameters:
  7436.         (s) server-name    name of the network file server.
  7437.         (s) message  message to be broadcast.
  7438.  
  7439.        Returns:
  7440.         (i)          @TRUE if successful; @FALSE if unsuccessful.
  7441.  
  7442.        This function may not work with all networks.
  7443.  
  7444.  
  7445.        Example:
  7446.         NetMsgAll("userapps", "System going down in 5 minutes.")
  7447.  
  7448.  
  7449.        See Also:
  7450.           NetMsgSend
  7451.  
  7452.  
  7453.  
  7454.  
  7455.        NetMsgSend
  7456.        Sends a message to a specific user on the network.
  7457.  
  7458.  
  7459.        Syntax:
  7460.         NetMsgSend (server-name, user-name, message)
  7461.  
  7462.        Parameters:
  7463.         (s) server-name    name of the network file server.
  7464.         (s) user-name name of the user to whom the message should be sent.
  7465.         (s) message  message to be sent.
  7466.  
  7467.  
  7468.  
  7469.  
  7470.  
  7471.  
  7472.        Returns:
  7473.         (i)          @TRUE if successful; @FALSE if unsuccessful.
  7474.  
  7475.        This function may not work with all networks.
  7476.  
  7477.  
  7478.        Example:
  7479.         NetMsgSend("userapps", "compmgr", "Are those reports ready yet?")
  7480.  
  7481.  
  7482.        See Also:
  7483.           NetMsgAll
  7484.  
  7485.  
  7486.  
  7487.  
  7488.        Num2Char
  7489.        Converts a number to its character equivalent.
  7490.  
  7491.  
  7492.        Syntax:
  7493.         Num2Char (integer)
  7494.  
  7495.        Parameters:
  7496.         (i) number   any number from 0 to 255.
  7497.  
  7498.        Returns:
  7499.         (s)          one-byte string containing the character which the
  7500.                      number represents.
  7501.  
  7502.        Use this function to convert a number to its ASCII equivalent.
  7503.  
  7504.  
  7505.        Example:
  7506.         ; Build a variable containing a CRLF combo
  7507.         crlf = StrCat(Num2Char(13), Num2Char(10))
  7508.         Message("NUM2CHAR", StrCat("line1", crlf, "line2"))
  7509.  
  7510.  
  7511.        See Also:
  7512.           Char2Num, IsNumber
  7513.  
  7514.  
  7515.  
  7516.  
  7517.        ParseData
  7518.        Parses the passed string.
  7519.  
  7520.  
  7521.        Syntax:
  7522.         ParseData (string)
  7523.  
  7524.        Parameters:
  7525.         (s) string   string to be parsed.
  7526.  
  7527.  
  7528.  
  7529.  
  7530.  
  7531.  
  7532.        Returns:
  7533.         (i)          number of parameters in string.
  7534.  
  7535.        This function breaks a string constant or string variable into new
  7536.        sub-string variables named param1, param2, etc. (maximum of nine
  7537.        parameters).  Blank spaces in the original string are used as
  7538.        delimiters to create the new variables.
  7539.  
  7540.        Param0 is the count of how many sub-strings are found in "string".
  7541.  
  7542.  
  7543.        Example:
  7544.         username = AskLine("Hello", "Please enter your name","")
  7545.         ParseData(username)
  7546.  
  7547.        If the user enters:
  7548.  
  7549.           Joe Q. User
  7550.  
  7551.        ParseData would create the following variables:
  7552.  
  7553.           param1 ==   Joe
  7554.           param2 ==   Q.
  7555.           param3 ==   User
  7556.           param0 ==   3
  7557.  
  7558.  
  7559.        See Also:
  7560.           ItemExtract, StrSub
  7561.  
  7562.  
  7563.  
  7564.  
  7565.        Pause
  7566.        Provides a message to user.  User may cancel processing.
  7567.  
  7568.  
  7569.        Syntax:
  7570.         Pause (title, text)
  7571.  
  7572.        Parameters:
  7573.         (s) title    title of pause box.
  7574.         (s) text     text of the message to be displayed.
  7575.  
  7576.        Returns:
  7577.         (i)          always 1.
  7578.  
  7579.        This function displays a message to the user with an exclamation point
  7580.        icon.  The user may respond by selecting the OK button, or may cancel
  7581.        the processing by selecting Cancel.
  7582.  
  7583.        The Pause function is similar to the Message function, except for the
  7584.        addition of the Cancel button and icon.
  7585.  
  7586.  
  7587.  
  7588.  
  7589.  
  7590.  
  7591.        Example:
  7592.         Pause("Change Disks", "Insert new disk into Drive A:")
  7593.  
  7594.        which produces:
  7595.  
  7596.  
  7597.  
  7598.  
  7599.  
  7600.  
  7601.  
  7602.  
  7603.  
  7604.  
  7605.        See Also:
  7606.           Display, Exit, Message, Terminate
  7607.  
  7608.  
  7609.  
  7610.  
  7611.        PlayMedia
  7612.        Controls multimedia devices.
  7613.  
  7614.  
  7615.        Syntax:
  7616.         PlayMedia (command-string)
  7617.  
  7618.        Parameters:
  7619.         (s) command-string string to be sent to the multimedia device.
  7620.  
  7621.        Returns:
  7622.         (s)          response from the device.
  7623.  
  7624.        If the appropriate Windows multimedia extensions are present, this
  7625.        function can control multimedia devices.  Valid command strings depend
  7626.        on the multimedia devices and drivers installed.  The basic Windows
  7627.        multimedia package has a waveform device to play and record waveforms,
  7628.        and a sequencer device to play MID files.  Refer to the appropriate
  7629.        documentation for information on command strings.
  7630.  
  7631.        Many multimedia devices accept the WAIT or NOTIFY parameters as part
  7632.        of the command string:
  7633.  
  7634.           WAIT      Causes the system to stop processing input until the 
  7635.                     requested operation is complete.  You cannot switch
  7636.           tasks     when WAIT is specified.
  7637.  
  7638.           NOTIFY    Causes the WIL program to suspend execution until the 
  7639.                     requested operation completes.  You can perform other 
  7640.                     tasks and switch between tasks when NOTIFY is specified.
  7641.  
  7642.           WAIT NOTIFY Same as WAIT
  7643.  
  7644.        If neither WAIT nor NOTIFY is specified, the multimedia operation is
  7645.        started and control returns immediately to the WIL program.
  7646.  
  7647.  
  7648.  
  7649.  
  7650.  
  7651.        In general, if you simply want the WIL program to wait until the
  7652.        multimedia operation is complete, use the NOTIFY keyword.  If you want
  7653.        the system to hang until the operation is complete, use WAIT.  If you
  7654.        just want to start a multimedia operation and have the program
  7655.        continue processing, don't use either keyword.
  7656.  
  7657.        The return value from PlayMedia is whatever string the driver returns.
  7658.        This will depend on the particular driver, as well as on the type of
  7659.        operation performed.
  7660.  
  7661.  
  7662.        Example:
  7663.         ; Plays a music CD on a CDAudio player.  It plays whatever is in the
  7664.         ; drive, from start to finish
  7665.         stat = PlayMedia("status cdaudio mode")
  7666.         answer = 1
  7667.         If stat == "playing" Then answer = AskYesNo("CD Audio", "CD is
  7668.             Playing.  Stop?")
  7669.         If answer == 0 Then Exit
  7670.         PlayMedia("open cdaudio shareable alias donna notify")
  7671.         PlayMedia("set donna time format tmsf")
  7672.         PlayMedia("play donna from 1")
  7673.         PlayMedia("close donna")
  7674.         Exit
  7675.         :cancel
  7676.         PlayMedia("set cdaudio door open")
  7677.  
  7678.  
  7679.        See Also:
  7680.           Beep, PlayMidi, PlayWaveForm, Sounds
  7681.  
  7682.  
  7683.  
  7684.  
  7685.        PlayMidi
  7686.        Plays a MID or RMI sound file.
  7687.  
  7688.  
  7689.        Syntax:
  7690.         PlayMidi (filename, mode)
  7691.  
  7692.        Parameters:
  7693.         (s) filename name of the MID or RMI sound file.
  7694.         (i) mode     play mode (see below).
  7695.  
  7696.        Returns:
  7697.         (i)          @TRUE if successful; @FALSE if unsuccessful.
  7698.  
  7699.        If Windows multimedia sound extensions are present, and MIDI-
  7700.        compatible hardware is installed, this function will play a MID or RMI
  7701.        sound file.  If "filename" is not in the current directory and a
  7702.        directory is not specified, the path will be searched to find the
  7703.        file.
  7704.  
  7705.        If "mode" is set to 0, the WIL program will wait for the sound file to
  7706.        complete before continuing.  If "mode" is set to 1, it will start
  7707.        playing the sound file and continue immediately.
  7708.  
  7709.  
  7710.  
  7711.  
  7712.  
  7713.  
  7714.        Example:
  7715.         PlayMidi("canyon.mid", 1)
  7716.  
  7717.  
  7718.        See Also:
  7719.           Beep, PlayMedia, PlayWaveForm, Sounds
  7720.  
  7721.  
  7722.  
  7723.  
  7724.        PlayWaveForm
  7725.        Plays a WAV sound file.
  7726.  
  7727.  
  7728.        Syntax:
  7729.         PlayWaveForm (filename, mode)
  7730.  
  7731.        Parameters:
  7732.         (s) filename
  7733.         (i) mode     play mode (see below).
  7734.  
  7735.        Returns:
  7736.         (i)          @TRUE if successful; @FALSE if unsuccessful.
  7737.  
  7738.        If Windows multimedia sound extensions are present, and waveform-
  7739.        compatible hardware is installed, this function will play a WAV sound
  7740.        file.  If "filename" is not in the current directory and a directory
  7741.        is not specified, the path will be searched to find the file.  If
  7742.        "filename is not found, the WAV file associated with the
  7743.        "SystemDefault" keyword is played, (unless the "NoDefault" setting is
  7744.        on).
  7745.  
  7746.        Instead of specifying an actual filename, you may specify a keyword
  7747.        name from the [Sound] section of the WIN.INI file (eg, "SystemStart"),
  7748.        in which case the WAV file associated with that keyword name will be
  7749.        played.
  7750.  
  7751.        "Mode" is a bitmask, composed of the following bits:
  7752.  
  7753.           Mode Meaning
  7754.  
  7755.           0    Wait for the sound to end before continuing.
  7756.           1    Don't wait for the sound to end.  Start the sound and
  7757.           immediately process more statements.
  7758.           2    If sound file not found, do not play a default sound
  7759.           9    Continue playing the sound forever, or until a
  7760.                PlayWaveForm("", 0) statement is executed
  7761.           16   If another sound is already playing, do not interrupt it.
  7762.           Just ignore this PlayWaveForm request.
  7763.  
  7764.        You can combine these bits using the binary OR operator.
  7765.  
  7766.        The command PlayWaveForm("", 0) can be used at any time to stop sound.
  7767.  
  7768.  
  7769.  
  7770.  
  7771.  
  7772.  
  7773.        Examples:
  7774.         PlayWaveForm("tada.wav", 0)
  7775.  
  7776.         PlayWaveForm("SystemDefault", 1 | 16)
  7777.  
  7778.  
  7779.        See Also:
  7780.           Beep, PlayMedia, PlayMidi, Sounds
  7781.  
  7782.  
  7783.  
  7784.  
  7785.        Random
  7786.        Computes a pseudo-random number.
  7787.  
  7788.  
  7789.        Syntax:
  7790.         Random (max)
  7791.  
  7792.        Parameters:
  7793.         (i) max      largest desired integer number.
  7794.  
  7795.        Returns:
  7796.         (i)          unpredictable positive number.
  7797.  
  7798.        This function will return a random integer between 0 and max.
  7799.  
  7800.  
  7801.        Example:
  7802.         a = Random(79)
  7803.         Message("Random number between 0 and 79", a)
  7804.  
  7805.  
  7806.        See Also:
  7807.           Average, Max, Min
  7808.  
  7809.  
  7810.  
  7811.  
  7812.        Return
  7813.        Used to return from a Call to the calling program.
  7814.  
  7815.  
  7816.        Syntax:
  7817.         Return
  7818.  
  7819.        Parameters:
  7820.         (none)
  7821.  
  7822.        Returns:
  7823.         (not applicable)
  7824.  
  7825.  
  7826.        If the program was not called, then an Exit is assumed.
  7827.  
  7828.  
  7829.  
  7830.  
  7831.  
  7832.  
  7833.        Example:
  7834.         Display(2, "End of subroutine", "Returning to MAIN.WBT")
  7835.         Return
  7836.  
  7837.  
  7838.        See Also:
  7839.           Call, Exit
  7840.  
  7841.  
  7842.  
  7843.  
  7844.        Run
  7845.        Runs a program as a normal window.
  7846.  
  7847.  
  7848.        Syntax:
  7849.         Run (program-name, parameters)
  7850.  
  7851.        Parameters:
  7852.         (s) program-name   the name of the desired .EXE, .COM, .PIF, .BAT
  7853.                      file, or a data file.
  7854.         (s) parameters     optional parameters as required by the
  7855.                      application.
  7856.  
  7857.        Returns:
  7858.         (i)          @TRUE if the program was found;
  7859.                      @FALSE if it wasn't.
  7860.  
  7861.        Use this command to run an application.
  7862.  
  7863.        If the drive and path are not part of the program name, the current
  7864.        directory will be examined first, followed by the Windows and Windows
  7865.        System directories, and then the DOS path will be searched to find the
  7866.        desired executable file.
  7867.  
  7868.        If the "program-name" doesn't have an extension of .EXE, .COM, .PIF,
  7869.        or .BAT, it will be run in accordance with whatever is in the
  7870.        [extensions] section of the WIN.INI file.  When this happens, any
  7871.        "parameters" you specified are ignored.
  7872.  
  7873.  
  7874.        Examples:
  7875.         Run("notepad.exe", "abc.txt")
  7876.  
  7877.         Run("clock.exe", "")
  7878.  
  7879.         Run("paint.exe", "pict.msp")
  7880.  
  7881.  
  7882.        See Also:
  7883.           AppExist, RunHide, RunIcon, RunWait, RunZoom, WinClose, WinExeName,
  7884.           WinWaitClose
  7885.  
  7886.  
  7887.  
  7888.  
  7889.  
  7890.  
  7891.  
  7892.  
  7893.        RunHide
  7894.        Runs a program as a hidden window.
  7895.  
  7896.  
  7897.        Syntax:
  7898.         RunHide (program-name, parameters)
  7899.  
  7900.        Parameters:
  7901.         (s) program-name   the name of the desired .EXE, .COM, .PIF, .BAT
  7902.                      file, or a data file.
  7903.         (s) parameters     optional parameters as required by the
  7904.                      application.
  7905.  
  7906.        Returns:
  7907.         (i)          @TRUE if the program was found;
  7908.                      @FALSE if it wasn't.
  7909.  
  7910.        Use this command to run an application as a hidden window.
  7911.  
  7912.        If the drive and path are not part of the program name, the current
  7913.        directory will be examined first, followed by the Windows and Windows
  7914.        System directories, and then the DOS path will be searched to find the
  7915.        desired executable file.
  7916.  
  7917.        If the "program-name" doesn't have an extension of .EXE, .COM, .PIF,
  7918.        or .BAT, it will be run in accordance with whatever is in the
  7919.        [extensions] section of the WIN.INI file.  When this happens, any
  7920.        "parameters" you specified are ignored.
  7921.  
  7922.        Note:  When this command launches an application, it informs it that
  7923.        you want it to run as a hidden window.  Whether or not the application
  7924.        honors your wish is beyond RunHide's control.
  7925.  
  7926.  
  7927.        Examples:
  7928.         RunHide("notepad.exe", "abc.txt")
  7929.  
  7930.         RunHide("clock.exe", "")
  7931.  
  7932.         RunHide("paint.exe", "pict.msp")
  7933.  
  7934.  
  7935.        See Also:
  7936.           Run, RunHideWait, RunIcon, RunZoom, WinClose, WinExeName, WinHide,
  7937.           WinWaitClose
  7938.  
  7939.  
  7940.  
  7941.  
  7942.        RunHideWait
  7943.        Runs a program as a hidden window, and waits for it to close.
  7944.  
  7945.  
  7946.  
  7947.  
  7948.  
  7949.  
  7950.        Syntax:
  7951.         RunHideWait (program-name, parameters)
  7952.  
  7953.        Parameters:
  7954.         (s) program-name   the name of the desired .EXE, .COM, .PIF, .BAT
  7955.                      file, or a data file.
  7956.         (s) parameters     optional parameters as required by the
  7957.                      application.
  7958.  
  7959.        Returns:
  7960.         (i)          @TRUE if the program was found;
  7961.                      @FALSE if it wasn't.
  7962.  
  7963.        Use this command to run an application as a hidden window.  The WIL
  7964.        program will suspend processing until the application is closed.
  7965.  
  7966.        If the drive and path are not part of the program name, the current
  7967.        directory will be examined first, followed by the Windows and Windows
  7968.        System directories, and then the DOS path will be searched to find the
  7969.        desired executable file.
  7970.  
  7971.        If the "program-name" doesn't have an extension of .EXE, .COM, .PIF,
  7972.        or .BAT, it will be run in accordance with whatever is in the
  7973.        [extensions] section of the WIN.INI file.  When this happens, any
  7974.        "parameters" you specified are ignored.
  7975.  
  7976.        Note:  When this command launches an application, it informs it that
  7977.        you want it to run as a hidden window.  Whether or not the application
  7978.        honors your wish is beyond RunHideWait's control.
  7979.  
  7980.  
  7981.        Example:
  7982.         NetAddCon("winword", "", "g:")
  7983.         RunHideWait("winword.exe", "")
  7984.         NetCancelCon("g:", 0)
  7985.  
  7986.  
  7987.        See Also:
  7988.           RunHide, RunIconWait, RunWait, RunZoomWait, WinWaitClose
  7989.  
  7990.  
  7991.  
  7992.  
  7993.        RunIcon
  7994.        Runs a program as an iconic (minimized) window.
  7995.  
  7996.  
  7997.        Syntax:
  7998.         RunIcon (program-name, parameters)
  7999.  
  8000.        Parameters:
  8001.         (s) program-name   the name of the desired .EXE, .COM, .PIF, .BAT
  8002.                      file, or a data file.
  8003.         (s) parameters     optional parameters as required by the
  8004.                      application.
  8005.  
  8006.  
  8007.  
  8008.  
  8009.  
  8010.  
  8011.        Returns:
  8012.         (i)          @TRUE if the program was found;
  8013.                      @FALSE if it wasn't.
  8014.  
  8015.        Use this command to run an application as an icon.
  8016.  
  8017.        If the drive and path are not part of the program name, the current
  8018.        directory will be examined first, followed by the Windows and Windows
  8019.        System directories, and then the DOS path will be searched to find the
  8020.        desired executable file.
  8021.  
  8022.        If the "program-name" doesn't have an extension of .EXE, .COM, .PIF,
  8023.        or .BAT, it will be run in accordance with whatever is in the
  8024.        [extensions] section of the WIN.INI file.  When this happens, any
  8025.        "parameters" you specified are ignored.
  8026.  
  8027.        Note:  When this command launches an application, it merely informs it
  8028.        that you want it to begin as an icon.  Whether or not the application
  8029.        honors your wish is beyond RunIcon's control.
  8030.  
  8031.  
  8032.        Examples:
  8033.         RunIcon("notepad.exe", "abc.txt")
  8034.  
  8035.         RunIcon("clock.exe", "")
  8036.  
  8037.         RunIcon("paint.exe", "pict.msp")
  8038.  
  8039.  
  8040.        See Also:
  8041.           IconArrange, Run, RunHide, RunIconWait, RunZoom, WinClose,
  8042.           WinExeName, WinIconize, WinWaitClose
  8043.  
  8044.  
  8045.  
  8046.  
  8047.        RunIconWait
  8048.        Runs a program as an iconic (minimized) window, and waits for it to
  8049.        close.
  8050.  
  8051.  
  8052.        Syntax:
  8053.         RunIconWait (program-name, parameters)
  8054.  
  8055.        Parameters:
  8056.         (s) program-name   the name of the desired .EXE, .COM, .PIF, .BAT
  8057.                      file, or a data file.
  8058.         (s) parameters     optional parameters as required by the
  8059.                      application.
  8060.  
  8061.        Returns:
  8062.         (i)          @TRUE if the program was found;
  8063.                      @FALSE if it wasn't.
  8064.  
  8065.        Use this command to run an application as an icon.  The WIL program
  8066.        will suspend processing until the application is closed.
  8067.  
  8068.  
  8069.  
  8070.  
  8071.  
  8072.        If the drive and path are not part of the program name, the current
  8073.        directory will be examined first, followed by the Windows and Windows
  8074.        System directories, and then the DOS path will be searched to find the
  8075.        desired executable file.
  8076.  
  8077.        If the "program-name" doesn't have an extension of .EXE, .COM, .PIF,
  8078.        or .BAT, it will be run in accordance with whatever is in the
  8079.        [extensions] section of the WIN.INI file.  When this happens, any
  8080.        "parameters" you specified are ignored.
  8081.  
  8082.        Note:  When this command launches an application, it merely informs it
  8083.        that you want it to begin as an icon.  Whether or not the application
  8084.        honors your wish is beyond RunIconWait's control.
  8085.  
  8086.  
  8087.        Example:
  8088.         NetAddCon("winword", "", "g:")
  8089.         RunIconWait("winword.exe", "")
  8090.         NetCancelCon("g:", 0)
  8091.  
  8092.  
  8093.        See Also:
  8094.           IconArrange, RunHideWait, RunIcon, RunWait, RunZoomWait,
  8095.           WinWaitClose
  8096.  
  8097.  
  8098.  
  8099.  
  8100.        RunWait
  8101.        Runs a program as a normal window, and waits for it to close.
  8102.  
  8103.  
  8104.        Syntax:
  8105.         RunWait (program-name, parameters)
  8106.  
  8107.        Parameters:
  8108.         (s) program-name   the name of the desired .EXE, .COM, .PIF, .BAT
  8109.                      file, or a data file.
  8110.         (s) parameters     optional parameters as required by the
  8111.                      application.
  8112.  
  8113.        Returns:
  8114.         (i)          @TRUE if the program was found;
  8115.                      @FALSE if it wasn't.
  8116.  
  8117.        Use this command to run an application.  The WIL program will suspend
  8118.        processing until the application is closed.
  8119.  
  8120.        If the drive and path are not part of the program name, the current
  8121.        directory will be examined first, followed by the Windows and Windows
  8122.        System directories, and then the DOS path will be searched to find the
  8123.        desired executable file.
  8124.  
  8125.        If the "program-name" doesn't have an extension of .EXE, .COM, .PIF,
  8126.        or .BAT, it will be run in accordance with whatever is in the
  8127.        [extensions] section of the WIN.INI file.  When this happens, any
  8128.        "parameters" you specified are ignored.
  8129.  
  8130.  
  8131.  
  8132.  
  8133.  
  8134.  
  8135.        Example:
  8136.         NetAddCon("winword", "", "g:")
  8137.         RunWait("winword.exe", "")
  8138.         NetCancelCon("g:", 0)
  8139.  
  8140.  
  8141.        See Also:
  8142.           AppWaitClose, Run, RunHideWait, RunIconWait, RunZoomWait,
  8143.           WinWaitClose
  8144.  
  8145.  
  8146.  
  8147.  
  8148.        RunZoom
  8149.        Runs a program as a full-screen (maximized) window.
  8150.  
  8151.  
  8152.        Syntax:
  8153.         RunZoom (program-name, parameters)
  8154.  
  8155.        Parameters:
  8156.         (s) program-name   the name of the desired .EXE, .COM, .PIF, .BAT
  8157.                      file, or a data file.
  8158.         (s) parameters     optional parameters as required by the
  8159.                      application.
  8160.  
  8161.        Returns:
  8162.         (i)          @TRUE if the program was found;
  8163.                      @FALSE if it wasn't.
  8164.  
  8165.        Use this command to run an application as a full-screen window.
  8166.  
  8167.        If the drive and path are not part of the program name, the current
  8168.        directory will be examined first, followed by the Windows and Windows
  8169.        System directories, and then the DOS path will be searched to find the
  8170.        desired executable file.
  8171.  
  8172.        If the "program-name" doesn't have an extension of .EXE, .COM, .PIF,
  8173.        or .BAT, it will be run in accordance with whatever is in the
  8174.        [Extensions] section of the WIN.INI file.  When this happens, any
  8175.        "parameters" you specified are ignored.
  8176.  
  8177.        Note:  When this command launches an application, it merely informs it
  8178.        that you want it to be maximized to full-screen.  Whether or not the
  8179.        application honors your wish is beyond RunZoom's control.
  8180.  
  8181.  
  8182.        Examples:
  8183.         RunZoom("notepad.exe", "abc.txt")
  8184.  
  8185.         RunZoom("clock.exe", "")
  8186.  
  8187.         RunZoom("paint.exe", "pict.msp")
  8188.  
  8189.  
  8190.  
  8191.  
  8192.  
  8193.  
  8194.        See Also:
  8195.           Run, RunHide, RunIcon, RunZoomWait, WinClose, WinExeName,
  8196.           WinWaitClose, WinZoom
  8197.  
  8198.  
  8199.  
  8200.  
  8201.        RunZoomWait
  8202.        Runs a program as a full-screen (maximized) window, and waits for it
  8203.        to close.
  8204.  
  8205.  
  8206.        Syntax:
  8207.         RunZoomWait (program-name, parameters)
  8208.  
  8209.        Parameters:
  8210.         (s) program-name   the name of the desired .EXE, .COM, .PIF, .BAT
  8211.                      file, or a data file.
  8212.         (s) parameters     optional parameters as required by the
  8213.                      application.
  8214.  
  8215.        Returns:
  8216.         (i)          @TRUE if the program was found;
  8217.                      @FALSE if it wasn't.
  8218.  
  8219.        Use this command to run an application as a full-screen window.  The
  8220.        WIL program will suspend processing until the application is closed.
  8221.  
  8222.        If the drive and path are not part of the program name, the current
  8223.        directory will be examined first, followed by the Windows and Windows
  8224.        System directories, and then the DOS path will be searched to find the
  8225.        desired executable file.
  8226.  
  8227.        If the "program-name" doesn't have an extension of .EXE, .COM, .PIF,
  8228.        or .BAT, it will be run in accordance with whatever is in the
  8229.        [Extensions] section of the WIN.INI file.  When this happens, any
  8230.        "parameters" you specified are ignored.
  8231.  
  8232.        Note:  When this command launches an application, it merely informs it
  8233.        that you want it to be maximized to full-screen.  Whether or not the
  8234.        application honors your wish is beyond RunZoomWait's control.
  8235.  
  8236.  
  8237.        Example:
  8238.         NetAddCon("winword", "", "g:")
  8239.         RunZoomWait("winword.exe", "")
  8240.         NetCancelCon("g:", 0)
  8241.  
  8242.  
  8243.        See Also:
  8244.           RunHideWait, RunIconWait, RunWait, RunZoom, WinWaitClose
  8245.  
  8246.  
  8247.  
  8248.  
  8249.  
  8250.  
  8251.  
  8252.  
  8253.        SendKey
  8254.        Sends keystrokes to the active application.
  8255.  
  8256.  
  8257.        Syntax:
  8258.         SendKey (char-string)
  8259.  
  8260.        Parameters:
  8261.         (s) char-string    string of regular and/or special characters.
  8262.  
  8263.        Returns:
  8264.         (i)          always 0.
  8265.  
  8266.        This function is used to send keystrokes to the current window, just
  8267.        as if they had been entered from the keyboard.  Any alphanumeric
  8268.        character, and most punctuation marks and other symbols which appear
  8269.        on the keyboard, may be sent simply by placing it in the "char-
  8270.        string."  In addition, the following special characters, enclosed in
  8271.        "curly" braces, may be placed in "char-string" to send the
  8272.        corresponding special characters:
  8273.  
  8274.           Key         SendKey equivalent
  8275.  
  8276.           ~           {~}
  8277.           !           {!}
  8278.           ^           {^}
  8279.           +           {+}
  8280.  
  8281.           Alt         {ALT}
  8282.           Backspace   {BACKSPACE} or {BS}
  8283.           Caps Lock   {CAPSLOCK}
  8284.           Clear       {CLEAR}
  8285.           Delete      {DELETE} or {DEL}
  8286.           Down Arrow  {DOWN}
  8287.           End         {END}
  8288.           Enter       {ENTER} or ~
  8289.           Escape      {ESCAPE} or {ESC}
  8290.           F1 through F16   {F1} through {F16}
  8291.           Help        {HELP}
  8292.           Home        {HOME}
  8293.           Insert      {INSERT} or {INS}
  8294.           Left Arrow  {LEFT}
  8295.           Num Lock    {NUMLOCK}
  8296.           Page Down   {PGDN}
  8297.           Page Up     {PGUP}
  8298.           Print Screen{PRTSC}
  8299.           Right Arrow {RIGHT}
  8300.           Space       {SPACE} or {SP}
  8301.           Tab         {TAB}
  8302.           Up Arrow    {UP}
  8303.  
  8304.        To enter an Alt, Control, or Shift key combination, precede the
  8305.        desired character with one or more of the following symbols:
  8306.  
  8307.  
  8308.  
  8309.  
  8310.  
  8311.           Alt         !
  8312.           Control     ^
  8313.           Shift       +
  8314.  
  8315.        To enter Alt-S:
  8316.  
  8317.         SendKey("!S")
  8318.  
  8319.        To enter Ctrl-Shift-F7:
  8320.  
  8321.         SendKey("^+{F7}")
  8322.  
  8323.        You may also repeat a key by enclosing it in braces, followed by a
  8324.        space and the total number of repetitions desired.
  8325.  
  8326.        To type 20 asterisks:
  8327.  
  8328.         SendKey("{* 20}")
  8329.  
  8330.        To move the cursor down 8 lines:
  8331.  
  8332.         SendKey("{DOWN 8}")
  8333.  
  8334.        It is possible to use SendKey to send keystrokes to a DOS application,
  8335.        but only if you are running Windows in 386 Enhanced mode.  You would
  8336.        then transfer the keystrokes to the DOS application via the Clipboard.
  8337.        It is only possible to send standard ASCII characters to DOS
  8338.        applications; you cannot send function key or Alt-key combinations.
  8339.  
  8340.  
  8341.        Examples:
  8342.         ; start Notepad, and use *.* for filenames
  8343.         Run("notepad.exe", "")
  8344.         SendKey("!FO*.*~")
  8345.  
  8346.         ; run DOS batch file which starts our editor
  8347.         Run("edit.bat", "")
  8348.         ; wait 15 seconds for editor to load
  8349.         Delay(15)
  8350.         ; send string (with carriage return) to the clipboard
  8351.         crlf = StrCat(Num2Char(13), Num2Char(10))
  8352.         ClipPut("Hello%crlf%")
  8353.         ; paste contents of clipboard to DOS window
  8354.         SendKey("!{SP}EP")
  8355.  
  8356.  
  8357.        In those cases where you have an application which can accept text
  8358.        pasted in from the clipboard, it will often be more efficient to use
  8359.        the ClipGet function:
  8360.  
  8361.         Run("notepad.exe", "")
  8362.         crlf = StrCat(Num2Char(13), Num2Char(10))
  8363.         ; copy some text to the clipboard
  8364.         ClipPut("Dear Sirs:%crlf%%crlf%")
  8365.         ; paste the text into Notepad (using Shift-Ins)
  8366.         SendKey("+{INSERT}")
  8367.  
  8368.  
  8369.  
  8370.  
  8371.  
  8372.  
  8373.        See Also:
  8374.           ClipGet, SKDebug, SnapShot
  8375.  
  8376.  
  8377.  
  8378.  
  8379.        SKDebug
  8380.        Controls how SendKey works
  8381.  
  8382.  
  8383.        Syntax:
  8384.         SKDebug (mode)
  8385.  
  8386.        Parameters:
  8387.         (i) mode     @OFF       Keystrokes sent to application.  No debug
  8388.                      file  written.  Default mode.
  8389.                @ON         Keystrokes sent to application.  Debug file 
  8390.                            written.
  8391.                @PARSEONLY  Keystrokes not sent to application.  Debug file 
  8392.                            written.
  8393.  
  8394.        Returns:
  8395.         (i)    previous SKDebug mode.
  8396.  
  8397.        This function allows you to direct the keystrokes generated by your
  8398.        SendKey statements to a disk file in addition to, or instead of, the
  8399.        application window.  Normally, keystrokes are sent only to the
  8400.        application.  If you specify SKDebug (@ON), keystrokes are sent to a
  8401.        disk file as well as to the application.  If you specify SKDebug
  8402.        (@PARSEONLY), keystrokes are sent only to the disk file, and not to
  8403.        the application.  SKDebug (@OFF) returns to the default mode.
  8404.  
  8405.        By default, the file which will receive the parsed keystrokes is named
  8406.        C:\@@SKDBUG.TXT.  You can override this by making an entry in the
  8407.        WWWBATCH.INI file, in the [Main] section, as follows:
  8408.  
  8409.           SKDFile=debug.fil
  8410.  
  8411.        where debug.fil is the filename, including complete path
  8412.        specification, that you want to receive the keystrokes.
  8413.  
  8414.  
  8415.        Example:
  8416.         Run("notepad.exe", "")
  8417.         SKDebug(@ON)
  8418.         SendKey("!FO*.*~")
  8419.         SKDebug(@OFF)
  8420.  
  8421.  
  8422.        See Also:
  8423.           Debug, SendKey
  8424.  
  8425.  
  8426.  
  8427.  
  8428.  
  8429.  
  8430.  
  8431.  
  8432.        SnapShot
  8433.        Takes a snapshot of the screen and pastes it to the clipboard.
  8434.  
  8435.  
  8436.        Syntax:
  8437.         SnapShot (request#)
  8438.  
  8439.        Parameters:
  8440.         (i) request# see below.
  8441.  
  8442.        Returns:
  8443.         (i)          always 0.
  8444.  
  8445.           Req# Meaning
  8446.  
  8447.           0    Take snapshot of entire screen
  8448.           1    Take snapshot of client area of parent window of active window
  8449.           2    Take snapshot of entire area of parent window of active window
  8450.           3    Take snapshot of client area of active window
  8451.           4    Take snapshot of entire area of active window
  8452.  
  8453.  
  8454.        Example:
  8455.         SnapShot(2)
  8456.  
  8457.  
  8458.        See Also:
  8459.           ClipPut
  8460.  
  8461.  
  8462.  
  8463.  
  8464.        Sounds
  8465.        Turns sounds on or off.
  8466.  
  8467.  
  8468.        Syntax:
  8469.         Sounds (request#)
  8470.  
  8471.        Parameters:
  8472.         (i) request# see below.
  8473.  
  8474.        Returns:
  8475.         (i)          previous Sound setting.
  8476.  
  8477.        If Windows multimedia sound extensions are present, this function
  8478.        turns sounds made by the WIL Interpreter on or off.  Specify a
  8479.        request# of 0 to turn sounds off, and a request# of 1 to turn them on.
  8480.  
  8481.        By default, the WIL Interpreter makes noise.  You can override this by
  8482.        entering:
  8483.  
  8484.           Sounds=0
  8485.  
  8486.  
  8487.  
  8488.  
  8489.  
  8490.        in the [Main] section of the WWWBATCH.INI file.
  8491.  
  8492.  
  8493.        Example:
  8494.         Sounds(0)
  8495.  
  8496.        See Also:
  8497.           Beep, PlayMedia, PlayMidi, PlayWaveForm
  8498.  
  8499.  
  8500.  
  8501.  
  8502.        StrCat
  8503.        Concatenates two or more strings.
  8504.  
  8505.  
  8506.        Syntax:
  8507.         StrCat (string1, string2[, ..., stringN])
  8508.  
  8509.        Parameters:
  8510.         (s) string1, etc.  at least two strings you want to concatenate.
  8511.  
  8512.        Returns:
  8513.         (s)          concatenation of the entire list of input strings.
  8514.  
  8515.        Use this command to stick character strings together, or to format
  8516.        display messages.
  8517.  
  8518.  
  8519.        Example:
  8520.         user = AskLine("Login", "Your Name:", "")
  8521.         msg = StrCat("Hi, ", user)
  8522.         Message("Login", msg)
  8523.  
  8524.         ; note that this is the same as the second line above:
  8525.         msg = "Hi, %user%"
  8526.  
  8527.  
  8528.        See Also:
  8529.           StrFill, StrFix, StrTrim
  8530.  
  8531.  
  8532.  
  8533.  
  8534.        StrCmp
  8535.        Compares two strings.
  8536.  
  8537.  
  8538.        Syntax:
  8539.         StrCmp (string1, string2)
  8540.  
  8541.        Parameters:
  8542.         (s) string1, string2    strings to compare.
  8543.  
  8544.        Returns:
  8545.         (i)          -1, 0, or 1; depending on whether string1 is less than,
  8546.                      equal to, or greater than string2, respectively.
  8547.  
  8548.  
  8549.  
  8550.  
  8551.  
  8552.  
  8553.        Use this command to determine whether two strings are equal, or which
  8554.        precedes the other in an ANSI sorting sequence.
  8555.  
  8556.        Note:  This command has been included for semantic completeness.  The
  8557.        relational operators >, >=, ==, !=, <=, and < provide the same
  8558.        capability.
  8559.  
  8560.  
  8561.        Example:
  8562.         a = AskLine("STRCMP", "Enter a test line", "")
  8563.         b = AskLine("STRCMP", "Enter another test line", "")
  8564.         c = StrCmp(a, b)
  8565.         c = c + 1
  8566.         d = StrSub("less than   equal to    greater than", c * 12, 12)
  8567.         ; Note that above string is grouped into 12-character
  8568.         ; chunks.
  8569.         ; Desired chunk is removed with the StrSub statement.
  8570.         Message("STRCMP", "%a% is %d% %b%")
  8571.  
  8572.  
  8573.        See Also:
  8574.           StriCmp, StrIndex, StrLen, StrScan, StrSub
  8575.  
  8576.  
  8577.  
  8578.  
  8579.        StrFill
  8580.        Creates a string filled with a series of characters.
  8581.  
  8582.  
  8583.        Syntax:
  8584.         StrFill (filler, length)
  8585.  
  8586.        Parameters:
  8587.         (s) filler   a string to be repeated to create the return string.  If
  8588.                      the filler string is null, spaces will be used instead.
  8589.         (i) length   the length of the desired string.
  8590.  
  8591.        Returns:
  8592.         (s)          character string.
  8593.  
  8594.        Use this function to create a string consisting of multiple copies of
  8595.        the filler string concatenated together.
  8596.  
  8597.  
  8598.        Example:
  8599.         Message("My Stars", StrFill("*", 30))
  8600.  
  8601.        which produces:
  8602.  
  8603.  
  8604.  
  8605.  
  8606.  
  8607.  
  8608.        See Also:
  8609.           StrCat, StrFix, StrLen, StrTrim
  8610.  
  8611.  
  8612.  
  8613.  
  8614.        StrFix
  8615.        Pads or truncates a string to a fixed length.
  8616.  
  8617.  
  8618.        Syntax:
  8619.         StrFix (base-string, pad-string, length)
  8620.  
  8621.        Parameters:
  8622.         (s) base-string    string to be adjusted to a fixed length.
  8623.         (s) pad-string     appended to base-string if needed to fill out the
  8624.                      desired length.  If pad-string is null, spaces are used
  8625.                      instead.
  8626.         (i) length   length of the desired string.
  8627.  
  8628.        Returns:
  8629.         (s)          fixed size string.
  8630.  
  8631.        This function "fixes" the length of a string, either by truncating it
  8632.        on the right, or by appending enough copies of pad-string to achieve
  8633.        the desired length.
  8634.  
  8635.  
  8636.        Example:
  8637.         a = StrFix("Henry", " ", 15)
  8638.         b = StrFix("Betty", " ", 15)
  8639.         c = StrFix("George", " ", 15)
  8640.         Message("Spaced Names", StrCat(a, b, c))
  8641.  
  8642.        which produces:
  8643.  
  8644.  
  8645.  
  8646.  
  8647.  
  8648.  
  8649.  
  8650.  
  8651.  
  8652.        See Also:
  8653.           StrFill, StrLen, StrTrim
  8654.  
  8655.  
  8656.  
  8657.  
  8658.        StriCmp
  8659.        Compares two strings without regard to case.
  8660.  
  8661.  
  8662.        Syntax:
  8663.         StriCmp (string1, string2)
  8664.  
  8665.  
  8666.  
  8667.  
  8668.  
  8669.  
  8670.        Parameters:
  8671.         (s) string1, string2    strings to compare.
  8672.  
  8673.        Returns:
  8674.         (i)          -1, 0, or 1; depending on whether string1 is less than,
  8675.                      equal to, or greater than string2, respectively.
  8676.  
  8677.        Use this command to determine whether two strings are equal, or which
  8678.        precedes the other in an ANSI sorting sequence, when case is ignored.
  8679.  
  8680.  
  8681.        Example:
  8682.         a = AskLine("STRICMP", "Enter a test line", "")
  8683.         b = AskLine("STRICMP", "Enter another test line", "")
  8684.         c = StriCmp(a, b)
  8685.         c = c + 1
  8686.         d = StrSub("less than   equal to    greater than", c * 12, 12)
  8687.         ; Note that above string is grouped into 12-character
  8688.         ; chunks.
  8689.         ; Desired chunk is removed with the StrSub statement.
  8690.         Message("STRICMP", "%a% is %d% %b%")
  8691.  
  8692.  
  8693.        See Also:
  8694.           StrCmp, StrIndex, StrLen, StrScan, StrSub
  8695.  
  8696.  
  8697.  
  8698.  
  8699.        StrIndex
  8700.        Searches a string for a substring.
  8701.  
  8702.  
  8703.        Syntax:
  8704.         StrIndex (string, substring, start, direction)
  8705.  
  8706.        Parameters:
  8707.         (s) string   the string to be searched for a substring.
  8708.         (s) substring the string to look for within the main string.
  8709.         (i) start    the position in the main string to begin search.  The
  8710.                      first character of a string is position 1.
  8711.         (i) direction the search direction.  @FWDSCAN searches forward, while
  8712.                      @BACKSCAN searches backwards.
  8713.  
  8714.        Returns:
  8715.         (i)          position of substring within string, or 0 if not found.
  8716.  
  8717.        This function searches for a substring within a "target" string.
  8718.        Starting at the "start" position, it goes forward or backward
  8719.        depending on the value of the "direction" parameter.  It stops when it
  8720.        finds the "substring" within the "target" string, and returns its
  8721.        position.
  8722.  
  8723.        A start position of 0 has special meaning depending on which direction
  8724.        you are scanning.  For forward searches, zero indicates the search
  8725.  
  8726.  
  8727.  
  8728.  
  8729.  
  8730.        should start at the beginning of the string.  For reverse searches,
  8731.        zero causes it to start at the end of the string.
  8732.  
  8733.  
  8734.        Example:
  8735.         instr = AskLine("STRINDEX", "Type a sentence:", "")
  8736.         start = 1
  8737.         end = StrIndex(instr, " ", start, @FWDSCAN)
  8738.         If end == 0 Then Goto error
  8739.         Message("STRINDEX", StrCat("The first word is: ", StrSub(instr, 
  8740.             start, end - 1))
  8741.         Exit
  8742.         :error
  8743.         Message("Sorry...", "No spaces found")
  8744.  
  8745.  
  8746.        See Also:
  8747.           StrLen, StrScan, StrSub
  8748.  
  8749.  
  8750.  
  8751.  
  8752.        StrLen
  8753.        Provides the length of a string.
  8754.  
  8755.  
  8756.        Syntax:
  8757.         StrLen (string)
  8758.  
  8759.        Parameters:
  8760.         (s) string   any text string.
  8761.  
  8762.        Returns:
  8763.         (i)          length of string.
  8764.  
  8765.        Use this command to determine the length of a string variable or
  8766.        expression.
  8767.  
  8768.  
  8769.        Example:
  8770.         myfile = AskLine("Filename", "File to process:", "")
  8771.         namlen = StrLen(myfile)
  8772.         If namlen > 13 Then Message("", "Filename too long!")
  8773.  
  8774.  
  8775.        See Also:
  8776.           StrFill, StrFix, StrIndex, StrScan, StrTrim
  8777.  
  8778.  
  8779.  
  8780.  
  8781.        StrLower
  8782.        Converts a string to lowercase.
  8783.  
  8784.  
  8785.        Syntax:
  8786.         StrLower (string)
  8787.  
  8788.  
  8789.  
  8790.  
  8791.  
  8792.  
  8793.        Parameters:
  8794.         (s) string   any text string.
  8795.  
  8796.        Returns:
  8797.         (s)          lowercase string.
  8798.  
  8799.        Use this command to convert a text string to lower case.
  8800.  
  8801.  
  8802.        Example:
  8803.         a = AskLine("STRLOWER", "Enter text", "")
  8804.         b = StrLower(a)
  8805.         Message(a, b)
  8806.  
  8807.  
  8808.        See Also:
  8809.           StriCmp, StrUpper
  8810.  
  8811.  
  8812.  
  8813.  
  8814.        StrReplace
  8815.        Replaces all occurances of a substring with another.
  8816.  
  8817.  
  8818.        Syntax:
  8819.         StrReplace (string, old, new)
  8820.  
  8821.        Parameters:
  8822.         (s) string   string in which to search.
  8823.         (s) old      target substring.
  8824.         (s) new      replacement substring.
  8825.  
  8826.        Returns:
  8827.         (s)          updated string, with old replaced by new.
  8828.  
  8829.  
  8830.        StrReplace scans the "string", searching for occurrences of "old" and
  8831.        replacing each occurrence with "new".
  8832.  
  8833.  
  8834.        Example:
  8835.         ; Copy all INI files to clipboard
  8836.         a = FileItemize("*.ini")
  8837.         crlf = StrCat(Num2Char(13), Num2Char(10))
  8838.         b = StrReplace(a, " ", crlf)
  8839.         ClipPut(b)
  8840.  
  8841.  
  8842.        See Also:
  8843.           StrIndex, StrScan, StrSub
  8844.  
  8845.  
  8846.  
  8847.  
  8848.  
  8849.  
  8850.  
  8851.  
  8852.        StrScan
  8853.        Searches string for occurrence of delimiters.
  8854.  
  8855.  
  8856.        Syntax:
  8857.         StrScan (string, delimiters, start, direction)
  8858.  
  8859.        Parameters:
  8860.         (s) string   the string that is to be searched.
  8861.         (s) delimiters     a string of delimiters to search for within
  8862.                      string.
  8863.         (i) start    the position in the main string to begin search.  The
  8864.                      first character of a string is position 1.
  8865.         (i) direction the search direction.  @FWDSCAN searches forward, while
  8866.                      @BACKSCAN searches backwards.
  8867.  
  8868.        Returns:
  8869.         (i)          position of delimiter in string, or 0 if not found.
  8870.  
  8871.        This function searches for delimiters within a target "string".
  8872.        Starting at the "start" position, it goes forward or backward
  8873.        depending on the value of the "direction" parameter.  It stops when it
  8874.        finds any one of the characters in the "delimiters" string within the
  8875.        target "string".
  8876.  
  8877.  
  8878.        Example:
  8879.         thestr = "123,456.789:abc"
  8880.         start = 1
  8881.         end = StrScan(thestr, ",.:", start, @FWDSCAN)
  8882.         If end == 0 Then Goto error
  8883.         Message("The first parameter", StrSub(thestr, start, end -      start
  8884.         + 1))
  8885.         Exit
  8886.         :error
  8887.         Message("Sorry...", "No delimiters found")
  8888.  
  8889.  
  8890.        See Also:
  8891.           StrLen, StrSub
  8892.  
  8893.  
  8894.  
  8895.  
  8896.        StrSub
  8897.        Extracts a substring out of an existing string.
  8898.  
  8899.  
  8900.        Syntax:
  8901.         StrSub (string, start, length)
  8902.  
  8903.        Parameters:
  8904.         (s) string   the string from which the substring is to be extracted.
  8905.  
  8906.  
  8907.  
  8908.  
  8909.  
  8910.         (i) start    character position within string where the substring
  8911.                      starts.  (The first character of the string is at
  8912.                      position 1).
  8913.         (i) length   length of desired substring.  If you specify a length of
  8914.                      zero it will return a null string.
  8915.  
  8916.        Returns:
  8917.         (s)          substring of parameter string.
  8918.  
  8919.        This function extracts a substring from within a "target" string.
  8920.        Starting at the "start" position, it copies up to "length" characters
  8921.        into the substring.
  8922.  
  8923.  
  8924.        Example:
  8925.         a = "My dog has fleas"
  8926.         animal = StrSub(a, 4, 3)
  8927.         Message("STRSUB", "My animal is a %animal%")
  8928.  
  8929.  
  8930.        See Also:
  8931.           StrLen, StrScan
  8932.  
  8933.  
  8934.  
  8935.  
  8936.        StrTrim
  8937.        Removes leading and trailing blanks from a character string.
  8938.  
  8939.  
  8940.        Syntax:
  8941.         StrTrim (string)
  8942.  
  8943.        Parameters:
  8944.         (s) string   a string with unwanted spaces at the beginning and/or
  8945.                      end.
  8946.  
  8947.        Returns:
  8948.         (s)          string devoid of leading and trailing spaces.
  8949.  
  8950.        This function removes spaces and tab characters from the beginning and
  8951.        end of a text string.
  8952.  
  8953.  
  8954.        Example:
  8955.         myfile = AskLine("STRTRIM", "Filename ('exit' cancels)", "")
  8956.         tstexit = StrTrim(StrLower(myfile))
  8957.         If tstexit == "exit" Then Goto cancel
  8958.         ; processing of myfile continues...
  8959.         : cancel
  8960.         Message("Canceled", "...by user request")
  8961.  
  8962.  
  8963.        See Also:
  8964.           StrFill, StrFix, StrLen
  8965.  
  8966.  
  8967.  
  8968.  
  8969.  
  8970.  
  8971.  
  8972.  
  8973.        StrUpper
  8974.        Converts a string to uppercase.
  8975.  
  8976.  
  8977.        Syntax:
  8978.         StrUpper (string)
  8979.  
  8980.        Parameters:
  8981.         (s) string   any text string.
  8982.  
  8983.        Returns:
  8984.         (s)          uppercase string.
  8985.  
  8986.        Use this function to convert a text string to upper case.
  8987.  
  8988.  
  8989.        Example:
  8990.         a = AskLine("STRUPPER", "Enter text","")
  8991.         b = StrUpper(a)
  8992.         Message(a, b)
  8993.  
  8994.  
  8995.        See Also:
  8996.           StriCmp, StrLower
  8997.  
  8998.  
  8999.  
  9000.  
  9001.        Terminate
  9002.        Conditionally ends a WIL program.
  9003.  
  9004.  
  9005.        Syntax:
  9006.         Terminate (expression, title, message)
  9007.  
  9008.        Parameters:
  9009.         (s) expression     any logical expression.
  9010.         (s) title    the title of a message box to be displayed before
  9011.                      termination.
  9012.         (s) message  the message in the message box.
  9013.  
  9014.        Returns:
  9015.         (i)          always 1.
  9016.  
  9017.        This command ends processing for the WIL program if "expression" is
  9018.        nonzero.  Note that many functions return @TRUE (1) or @FALSE (0),
  9019.        which you can use to decide whether to cancel a menu item.
  9020.  
  9021.        If either "title" or "message" contains a string, a message box with a
  9022.        title and a message is displayed before exiting.
  9023.  
  9024.  
  9025.  
  9026.  
  9027.  
  9028.  
  9029.        Examples:
  9030.         ; unconditional termination w/o message box (same as Exit)
  9031.         Terminate(@TRUE, "", "")
  9032.  
  9033.         ; basically a no-op:
  9034.         Terminate(@FALSE, "", "This will never terminate")
  9035.  
  9036.         ; exits with message if variable is less than zero:
  9037.         Terminate(a < 0, "Error", "Cannot use negative numbers")
  9038.  
  9039.         ; exits w/o message if answer isn't "YES":
  9040.         Terminate(answer != "YES", "", "")
  9041.  
  9042.  
  9043.        See Also:
  9044.           Display, Exit, Message, Pause
  9045.  
  9046.  
  9047.  
  9048.  
  9049.        TextBox
  9050.        Displays a file in a listbox on the screen and returns selected line,
  9051.        if any.
  9052.  
  9053.  
  9054.        Syntax:
  9055.         TextBox (title, filename)
  9056.  
  9057.        Parameters:
  9058.         (s) title    listbox title.
  9059.         (s) filename file containing contents of listbox.
  9060.  
  9061.        Returns:
  9062.         (s)          highlighted string, if any.
  9063.  
  9064.        This function loads a file into a Windows listbox and displays the
  9065.        listbox to the user.  TextBox has two primary uses:  First, it can be
  9066.        used to display multi-line messages to the user.  In addition, because
  9067.        of its ability to return a selected line, it may be used as a multiple
  9068.        choice question box.  The line highlighted by the user (if any) will
  9069.        be returned to the program.
  9070.  
  9071.        If disk drive and path not are part of the filename, the current
  9072.        directory will be examined first, and then the DOS path will be
  9073.        searched to find the desired file.
  9074.  
  9075.  
  9076.        Example:
  9077.         ; Display WIN.INI
  9078.         a = TextBox("Choose a line", "c:\windows\win.ini")
  9079.         Display(3, "Chosen line", a)
  9080.  
  9081.        which produces (at least on my system):
  9082.  
  9083.  
  9084.  
  9085.  
  9086.  
  9087.  
  9088.  
  9089.  
  9090.  
  9091.  
  9092.  
  9093.  
  9094.  
  9095.  
  9096.  
  9097.  
  9098.  
  9099.  
  9100.  
  9101.  
  9102.  
  9103.        and then:
  9104.  
  9105.  
  9106.  
  9107.  
  9108.  
  9109.  
  9110.  
  9111.        See Also:
  9112.           ItemSelect, TextSelect
  9113.  
  9114.  
  9115.  
  9116.  
  9117.        TextSelect
  9118.        Allows the user to choose an item from an unsorted listbox.
  9119.  
  9120.  
  9121.        Syntax:
  9122.         TextSelect (title, list, delimiter)
  9123.  
  9124.        Parameters:
  9125.         (s) title    the title of dialog box to display.
  9126.         (s) list     a string containing a list of items to choose from.
  9127.         (s) delimiter a string containing the character to act as delimiter
  9128.                      between items in the list.
  9129.  
  9130.        Returns:
  9131.         (s)          the selected item.
  9132.  
  9133.        This function displays a dialog box with a listbox inside.  This
  9134.        listbox is filled with an unsorted list of items taken from a string
  9135.        you provide to the function.
  9136.  
  9137.        Each item in the string must be separated (delimited) by a character,
  9138.        which you also pass to the function.
  9139.  
  9140.        The user selects one of the items by either doubleclicking on it, or
  9141.        single-clicking and pressing OK.  The item is returned as a string.
  9142.  
  9143.  
  9144.  
  9145.  
  9146.  
  9147.        If you create the list with the FileItemize or DirItemize functions
  9148.        you will be using a space-delimited list.  WinItemize, however,
  9149.        creates a tab-delimited list of window titles since titles can have
  9150.        embedded blanks.
  9151.  
  9152.        TextSelect is like ItemSelect, except that with TextSelect the
  9153.        displayed box is larger and the items in the box are not sorted
  9154.        alphabetically.
  9155.  
  9156.  
  9157.        Example:
  9158.         DirChange(DirWindows(0))
  9159.         inifiles = FileItemize("*.ini")
  9160.         ini = TextSelect("Select an INI file to edit", inifiles, " ")
  9161.         If ini == "" Then Exit
  9162.         RunZoom("notepad.exe", ini)
  9163.  
  9164.  
  9165.        See Also:
  9166.           AskLine, DialogBox, DirItemize, FileItemize, ItemSelect, TextBox,
  9167.           WinItemize
  9168.  
  9169.  
  9170.  
  9171.  
  9172.        Then
  9173.        Continues a previous If statement.
  9174.  
  9175.  
  9176.        Syntax:
  9177.         Then statement
  9178.  
  9179.        Parameters:
  9180.         (s) statement any valid WIL function or command.
  9181.  
  9182.        This command continues the last-encountered If command.  It provides a
  9183.        method of conditionally executing multiple statements, without having
  9184.        to test the condition more than once.  If the previous If condition
  9185.        was true, the statement following the Then keyword is executed.  If
  9186.        the previous If condition was false, the statement following the Then
  9187.        keyword is ignored.
  9188.  
  9189.  
  9190.  
  9191.  
  9192.        Example:
  9193.         answer = AskYesNo("Financial Management", "Run WinCheck now?")
  9194.         If answer == @YES Then DirChange("c:\win\check")
  9195.         Then Run("wincheck.exe", "")
  9196.         Then WinWaitClose("WinCheck")
  9197.         Message("Okay", "Processing complete")
  9198.  
  9199.  
  9200.        See Also:
  9201.           Else, Goto, If ... Then
  9202.  
  9203.  
  9204.  
  9205.  
  9206.  
  9207.  
  9208.  
  9209.  
  9210.        Version
  9211.        Returns the version number of the parent program currently running.
  9212.  
  9213.  
  9214.        Syntax:
  9215.         Version ( )
  9216.  
  9217.        Parameters:
  9218.         (none)
  9219.  
  9220.        Returns:
  9221.         (s)          parent program version number.
  9222.  
  9223.        Use this function to determine the version of the parent program that
  9224.        is currently running.
  9225.  
  9226.  
  9227.        Example:
  9228.         ver = Version()
  9229.         Message("Version number", ver)
  9230.  
  9231.  
  9232.        See Also:
  9233.           DOSVersion, Environment, VersionDLL WinVersion
  9234.  
  9235.  
  9236.  
  9237.  
  9238.        VersionDLL
  9239.        Returns the version number of the WIL Interpreter currently running.
  9240.  
  9241.  
  9242.        Syntax:
  9243.         VersionDLL ( )
  9244.  
  9245.        Parameters:
  9246.         (none)
  9247.  
  9248.        Returns:
  9249.         (s)          WIL Interpreter version number.
  9250.  
  9251.        Use this function to determine the version of the WIL Interpreter that
  9252.        is currently running.  It is useful to verify that a WIL program
  9253.        generated with the latest version of the language will operate
  9254.        properly on what may be a different machine with a different version
  9255.        of the WIL Interpreter installed.
  9256.  
  9257.  
  9258.  
  9259.  
  9260.  
  9261.  
  9262.        Example:
  9263.         ver = VersionDLL()
  9264.         If ver >= "1.0c" Then Goto proceed
  9265.         Message("Sorry", "WIL Interpreter version 1.0c or higher required")
  9266.         Exit
  9267.         :proceed
  9268.         NetDialog()
  9269.  
  9270.  
  9271.        See Also:
  9272.           DOSVersion, Environment, Version, WinVersion
  9273.  
  9274.  
  9275.  
  9276.  
  9277.        WaitForKey
  9278.        Waits for a specific key to be pressed.
  9279.  
  9280.  
  9281.        Syntax:
  9282.         WaitForKey (key1, key2, key3, key4, key5)
  9283.  
  9284.        Parameters:
  9285.         (s) key1 - key5    five keystrokes to wait for.
  9286.  
  9287.        Returns:
  9288.         (i)          position of the selected keystroke (1-5).
  9289.  
  9290.        WaitForKey requires five parameters, each of which represents a
  9291.        keystroke (refer to the SendKey function for a list of special
  9292.        keycodes which can be used).  The WIL program will be suspended until
  9293.        one of the specified keys are pressed, at which time the WaitForKey
  9294.        function will return a number from 1 to 5, indicating the position of
  9295.        the "key" that was selected, and the program will continue.  You can
  9296.        specify a null string ("") for one or more of the "key" parameters if
  9297.        you don't need to use all five.
  9298.  
  9299.        WaitForKey will detect its keystrokes in most, but not all, Windows
  9300.        applications.  Any keystroke that is pressed is also passed on to the
  9301.        underlying application.
  9302.  
  9303.  
  9304.        Example:
  9305.         k = WaitForKey("{F11}", "{F12}", "{INSERT}", "", "")
  9306.         If k == 1 Then Message("WaitForKey", "You pressed the F11 key")
  9307.         If k == 2 Then Message("WaitForKey", "You pressed the F12 key")
  9308.         If k == 3 Then Message("WaitForKey", "You pressed the Insert key")
  9309.  
  9310.  
  9311.        See Also:
  9312.           IgnoreInput, IsKeyDown
  9313.  
  9314.  
  9315.  
  9316.  
  9317.  
  9318.  
  9319.  
  9320.  
  9321.        WallPaper
  9322.        Changes the Windows wallpaper.
  9323.  
  9324.  
  9325.        Syntax:
  9326.         WallPaper (bmp-name, tile)
  9327.  
  9328.  
  9329.        Parameters:
  9330.         (s) bmp-name Name of the BMP wallpaper file.
  9331.         (i) tile     @TRUE if wallpaper should be tiled;
  9332.                      @FALSE if wallpaper should not be tiled.
  9333.  
  9334.        Returns:
  9335.         (i)          always 0.
  9336.  
  9337.        This function immediately changes the Windows wallpaper.  It can even
  9338.        be used for wallpaper "slide shows."
  9339.  
  9340.  
  9341.        Example:
  9342.         DirChange("c:\windows")
  9343.         a = FileItemize("*.bmp")
  9344.         a = ItemSelect("Select New paper", a, " ")
  9345.         tile = @FALSE
  9346.         If FileSize(a) < 40000 Then tile = @TRUE
  9347.         Wallpaper(a, tile)
  9348.  
  9349.  
  9350.        See Also:
  9351.           WinParmSet
  9352.  
  9353.  
  9354.  
  9355.  
  9356.        WinActivate
  9357.        Activates a previously running window.
  9358.  
  9359.  
  9360.        Syntax:
  9361.         WinActivate (partial-winname)
  9362.  
  9363.        Parameters:
  9364.         (s) partial-winname     either an initial portion of, or an entire
  9365.                      window name.  The most-recently used window whose title
  9366.                      matches the name will be activated.
  9367.  
  9368.        Returns:
  9369.         (i)          @TRUE if a window was found to activate;
  9370.                      @FALSE if no windows were found.
  9371.  
  9372.        Use this function to activate windows for user input.
  9373.  
  9374.  
  9375.  
  9376.  
  9377.  
  9378.  
  9379.        Example:
  9380.         Run("notepad.exe", "")
  9381.         Run("clock.exe", "")
  9382.         WinActivate("Notepad")
  9383.  
  9384.  
  9385.        See Also:
  9386.           WinCloseNot, WinGetActive, WinName, WinShow
  9387.  
  9388.  
  9389.  
  9390.  
  9391.        WinArrange
  9392.        Arranges, tiles, and/or stacks application windows.
  9393.  
  9394.  
  9395.        Syntax:
  9396.         WinArrange (style)
  9397.  
  9398.        Parameters:
  9399.         (i) style    one of the following: @STACK, @TILE (or @ARRANGE),
  9400.                      @ROWS, or @COLUMNS.
  9401.  
  9402.        Returns:
  9403.         (i)          always 1.
  9404.  
  9405.        Use this function to rearrange the open windows on the screen.  (Any
  9406.        iconized programs are unaffected.)
  9407.  
  9408.        If there are more than four open windows and you specify @ROWS, or if
  9409.        there are more than three open windows and you specify @COLUMNS, @TILE
  9410.        will be used instead.
  9411.  
  9412.  
  9413.        Example:
  9414.         ; Reveal all windows
  9415.         WinArrange(@TILE)
  9416.  
  9417.  
  9418.        See Also:
  9419.           IconArrange, WinHide, WinIconize, WinItemize, WinPlace, WinShow,
  9420.           WinZoom
  9421.  
  9422.  
  9423.  
  9424.  
  9425.        WinClose
  9426.        Closes an open window.
  9427.  
  9428.  
  9429.        Syntax:
  9430.         WinClose (partial-winname)
  9431.  
  9432.  
  9433.  
  9434.  
  9435.  
  9436.  
  9437.        Parameters:
  9438.         (s) partial-winname     either an initial portion of, or an entire
  9439.                      window name.  The most-recently used window whose title
  9440.                      matches the name will be closed.
  9441.  
  9442.        Returns:
  9443.         (i)          @TRUE if a window was found to close;
  9444.                      @FALSE if no windows were found.
  9445.  
  9446.        Use this function to close windows.
  9447.  
  9448.        WinClose will not close the window which contains the currently-
  9449.        executing WIL file.  You can, however, use EndSession to end the
  9450.        current Windows session.
  9451.  
  9452.  
  9453.        Example:
  9454.         Run("notepad.exe", "")
  9455.         WinClose("Notepad")
  9456.  
  9457.  
  9458.        See Also:
  9459.           EndSession, WinCloseNot, WinHide, WinIconize, WinItemize,
  9460.           WinWaitClose
  9461.  
  9462.  
  9463.  
  9464.  
  9465.        WinCloseNot
  9466.        Closes all windows, except those provided as parameters.
  9467.  
  9468.  
  9469.        Syntax:
  9470.         WinCloseNot (partial-winname [, partial-winname...])
  9471.  
  9472.        Parameters:
  9473.         (s) partial-winname     either an initial portion of, or an entire
  9474.                      window name.  Any windows whose titles match the partial
  9475.                      names will stay open.
  9476.  
  9477.        Returns:
  9478.         (i)          always 1.
  9479.  
  9480.        Use this function to close all windows except those specifically
  9481.        listed in the parameter strings.
  9482.  
  9483.        At least one partial window name must be given.  A null-string
  9484.        parameter would match all windows, or, in other words, close nothing.
  9485.  
  9486.  
  9487.        Example:
  9488.         ; The statement below will close all windows except:
  9489.         ; 1) Program Manager (starts with 'Program')
  9490.         ; 2) Clock  (starts with 'Clo' )
  9491.         WinCloseNot("Program", "Clo")
  9492.  
  9493.  
  9494.  
  9495.  
  9496.  
  9497.  
  9498.        See Also:
  9499.           EndSession, WinClose, WinHide, WinIconize, WinItemize, WinWaitClose
  9500.  
  9501.  
  9502.  
  9503.  
  9504.        WinConfig
  9505.        Returns WIN3 mode flags.
  9506.  
  9507.  
  9508.        Syntax:
  9509.         WinConfig ( )
  9510.  
  9511.        Parameters:
  9512.         (none)
  9513.  
  9514.        Returns:
  9515.         (i)          sum of Windows configuration bits.
  9516.  
  9517.  
  9518.        Returns Windows configuration information as a number, which is the
  9519.        sum of the following individual bits:
  9520.  
  9521.           1    Protected Mode
  9522.           2    80286 CPU
  9523.           4    80386 CPU
  9524.           8    80486 CPU
  9525.           16   Standard Mode
  9526.           32   Enhanced Mode
  9527.           64   8086 CPU
  9528.           128  80186 CPU
  9529.           256  Large PageFrame
  9530.           512  Small PageFrame
  9531.           1024 80x87 Installed
  9532.  
  9533.        You will need to use bitwise operators to extract the individual bits.
  9534.  
  9535.  
  9536.        Examples:
  9537.         cfg = WinConfig()
  9538.         If cfg & 32 Then Display(2, "Windows Mode", "Enhanced Mode")
  9539.         If cfg & 16 Then Display(2, "Windows Mode", "Standard Mode")
  9540.         If !(cfg & 1) Then Display(2, "Windows Mode", "Real Mode")
  9541.  
  9542.         cfg = WinConfig()
  9543.         If cfg & 1024 Then Display(2, "Math co-processor", "Yes")
  9544.         If !(cfg & 1024) Then Display(2, "Math co-processor", "No")
  9545.  
  9546.        See Also:
  9547.           NetGetCaps, WinMetrics, WinParmGet, WinResources
  9548.  
  9549.  
  9550.  
  9551.  
  9552.  
  9553.  
  9554.  
  9555.  
  9556.        WinExeName
  9557.        Returns the name of the executable file which created a specified
  9558.        window.
  9559.  
  9560.  
  9561.        Syntax:
  9562.         WinExeName (partial-winname)
  9563.  
  9564.        Parameters:
  9565.         (s) partial-winname     the initial part of, or an entire, window
  9566.                      name.
  9567.  
  9568.        Returns:
  9569.         (s)          name of the EXE file.
  9570.  
  9571.        Returns the name of the EXE file which created the first window found
  9572.        whose title matches "partial-winname".
  9573.  
  9574.        "Partial-winname" is the initial part of a window name, and may be a
  9575.        complete window name.  It is case-sensitive.  You should specify
  9576.        enough characters so that "partial-winname" matches only one existing
  9577.        window.
  9578.  
  9579.  
  9580.        Example:
  9581.         prog = WinExeName("WinCheck")
  9582.         WinClose("WinCheck")
  9583.         Delay(5)
  9584.         Run(prog, "")
  9585.  
  9586.  
  9587.        See Also:
  9588.           AppExist, AppWaitClose, Run, WinExist, WinGetActive, WinName
  9589.  
  9590.  
  9591.  
  9592.  
  9593.        WinExist
  9594.        Tells if specified window exists.
  9595.  
  9596.  
  9597.        Syntax:
  9598.         WinExist (partial-winname)
  9599.  
  9600.        Parameters:
  9601.         (s) partial-winname     the initial part of, or an entire, window
  9602.                      name.
  9603.  
  9604.        Returns:
  9605.         (i)          @TRUE if a matching window is found;
  9606.                      @FALSE if a matching window is not found.
  9607.  
  9608.  
  9609.  
  9610.  
  9611.  
  9612.        Note: The partial window name you give must match the initial portion
  9613.        of the window name (as appears in the title bar) exactly, including
  9614.        proper case (upper or lower) and punctuation.
  9615.  
  9616.  
  9617.        Example:
  9618.         If WinExist("Clock") == @FALSE Then RunIcon("Clock", "")
  9619.  
  9620.        See Also:
  9621.           AppExist, WinActivate, WinClose, WinExeName, WinGetActive,
  9622.           WinItemize, WinState
  9623.  
  9624.  
  9625.  
  9626.  
  9627.        WinGetActive
  9628.        Gets the title of the active window.
  9629.  
  9630.  
  9631.        Syntax:
  9632.         WinGetActive ( )
  9633.  
  9634.        Parameters:
  9635.         (none)
  9636.  
  9637.        Returns:
  9638.         (s)          title of active window.
  9639.  
  9640.        Use this function to determine which window is currently active.
  9641.  
  9642.  
  9643.        Example:
  9644.         currentwin = WinGetActive()
  9645.  
  9646.  
  9647.        See Also:
  9648.           WinActivate, WinExeName, WinItemize, WinName, WinPlaceGet,
  9649.           WinPosition, WinTitle
  9650.  
  9651.  
  9652.  
  9653.  
  9654.        WinHide
  9655.        Hides a window.
  9656.  
  9657.  
  9658.        Syntax:
  9659.         WinHide (partial-winname)
  9660.  
  9661.        Parameters:
  9662.         (s) partial-winname     either an initial portion of, or an entire
  9663.                      window name.  The most-recently used window whose title
  9664.                      matches the name will be hidden.
  9665.  
  9666.        Returns:
  9667.         (i)          @TRUE if a window was found to hide;
  9668.                      @FALSE if no windows were found.
  9669.  
  9670.  
  9671.  
  9672.  
  9673.  
  9674.  
  9675.        Use this function to hide windows.  The programs are still running
  9676.        when they are hidden.
  9677.  
  9678.        A partial-window name of "" (null string) hides the window making the
  9679.        current call to the WIL Interpreter.
  9680.  
  9681.  
  9682.        Example:
  9683.         Run("notepad.exe", "")
  9684.         WinHide("Notepad")
  9685.         Delay(3)
  9686.         WinShow("Notepad")
  9687.  
  9688.  
  9689.        See Also:
  9690.           RunHide, WinClose, WinIconize, WinPlace
  9691.  
  9692.  
  9693.  
  9694.  
  9695.        WinIconize
  9696.        Iconizes a window.
  9697.  
  9698.  
  9699.        Syntax:
  9700.         WinIconize (partial-winname)
  9701.  
  9702.        Parameters:
  9703.         (s) partial-winname     either an initial portion of, or an entire
  9704.                      window name.  The most-recently used window whose title
  9705.                      matches the name will be iconized.
  9706.  
  9707.        Returns:
  9708.         (i)          @TRUE if a window was found to iconize;
  9709.                      @FALSE if no windows were found.
  9710.  
  9711.        Use this function to turn a window into an icon at the bottom of the
  9712.        screen.
  9713.  
  9714.        A partial-window name of "" (null string) iconizes the current WIL
  9715.        Interpreter window.
  9716.  
  9717.  
  9718.        Example:
  9719.         Run("clock.exe", "")
  9720.         WinIconize("Clo")  ; partial window name used here
  9721.  
  9722.  
  9723.        See Also:
  9724.           IconArrange, RunIcon, WinClose, WinHide, WinPlace, WinShow, WinZoom
  9725.  
  9726.  
  9727.  
  9728.  
  9729.        WinItemize
  9730.        Returns a tab-delimited list of all open windows.
  9731.  
  9732.  
  9733.  
  9734.  
  9735.  
  9736.  
  9737.        Syntax:
  9738.         WinItemize ( )
  9739.  
  9740.        Parameters:
  9741.         (none)
  9742.  
  9743.        Returns:
  9744.         (s)          list of the titles of all open windows.
  9745.  
  9746.        This function compiles a list of all the open application windows'
  9747.        titles and separates the titles by tabs.  This is especially useful in
  9748.        conjunction with the ItemSelect function, which enables the user to
  9749.        choose an item from such a tab-delimited list.
  9750.  
  9751.        Note this behaves somewhat differently than FileItemize and
  9752.        DirItemize, which create space-delimited lists.  This is because
  9753.        window titles regularly contain embedded spaces.
  9754.  
  9755.  
  9756.        Example:
  9757.         ; Find a window
  9758.         allwins = WinItemize()
  9759.         htab = Num2Char(9)
  9760.         mywind = ItemSelect("Windows", allwins, htab)
  9761.         WinActivate(mywind)
  9762.  
  9763.  
  9764.        See Also:
  9765.           DirItemize, FileItemize, ItemSelect, TextSelect, WinClose,
  9766.           WinCloseNot, WinGetActive, WinName, WinPlaceGet, WinPosition
  9767.  
  9768.  
  9769.  
  9770.  
  9771.        WinMetrics
  9772.        Returns Windows system information.
  9773.  
  9774.  
  9775.        Syntax:
  9776.         WinMetrics (request#)
  9777.  
  9778.        Parameters:
  9779.         (i) request# see below.
  9780.  
  9781.        Returns:
  9782.         (i)          see below.
  9783.  
  9784.        The request# parameter determines what piece of information will be
  9785.        returned.
  9786.  
  9787.  
  9788.  
  9789.  
  9790.  
  9791.           Req# Return value
  9792.           -1   Number of colors supported by video driver
  9793.           0    Width of screen, in pixels
  9794.           1    Height of screen, in pixels
  9795.           2    Width of arrow on vertical scrollbar
  9796.           3    Height of arrow on horizontal scrollbar
  9797.           4    Height of window title bar
  9798.           5    Width of window border lines
  9799.           6    Height of window border lines
  9800.           7    Width of dialog box frame
  9801.           8    Height of dialog box frame
  9802.           9    Height of thumb box on scrollbar
  9803.           10   Width of thumb box on scrollbar
  9804.           11   Width of an icon
  9805.           12   Height of an icon
  9806.           13   Width of a cursor
  9807.           14   Height of a cursor
  9808.           15   Height of a one line menu bar
  9809.           16   Width of full screen window
  9810.           17   Height of a full screen window
  9811.           18   Height of Kanji window (Japanese)
  9812.           19   Is a mouse present (0 = No, 1 = Yes)
  9813.           20   Height of arrow on vertical scrollbar
  9814.           21   Width of arrow on horizontal scrollbar
  9815.           22   Is debug version of Windows running (0 = No, 1 = Yes)
  9816.           23   Are Left and Right mouse buttons swapped (0 = No, 1 = Yes)
  9817.           24   Reserved
  9818.           25   Reserved
  9819.           26   Reserved
  9820.           27   Reserved
  9821.           28   Minimum width of a window
  9822.           29   Minimum height of a window
  9823.           30   Width of bitmaps in title bar
  9824.           31   Height of bitmaps in title bar
  9825.           32   Width of sizeable window frame
  9826.           33   Height of sizeable window frame
  9827.           34   Minimum tracking width of a window
  9828.           35   Minimum tracking height of a window
  9829.  
  9830.        Example:
  9831.         mouse = "NO"
  9832.         If WinMetrics(19) == 1 Then mouse = "YES"
  9833.         Message("Is there a mouse installed?", mouse)
  9834.  
  9835.  
  9836.        See Also:
  9837.           Environment, MouseInfo, NetGetCaps, WinConfig, WinParmGet,
  9838.           WinResources
  9839.  
  9840.  
  9841.  
  9842.  
  9843.        WinName
  9844.        Returns the name of the window calling the WIL Interpreter.
  9845.  
  9846.  
  9847.  
  9848.  
  9849.  
  9850.  
  9851.        Syntax:
  9852.         WinName ( )
  9853.  
  9854.        Parameters:
  9855.         (none)
  9856.  
  9857.        Returns:
  9858.         (s)          window name.
  9859.  
  9860.        Returns the name of the window making the current call to the WIL
  9861.        Interpreter.
  9862.  
  9863.  
  9864.        Example:
  9865.         tab = Num2Char(9)
  9866.         allwins = WinItemize()
  9867.         win = ItemSelect("Close window", allwins, tab)
  9868.         If win == WinName() Then Goto nocando
  9869.         WinClose(win)
  9870.         Exit
  9871.         :nocando
  9872.         Message("Sorry", "I can't close myself")
  9873.  
  9874.  
  9875.        See Also:
  9876.           WinActivate, WinExeName, WinGetActive, WinItemize, WinTitle
  9877.  
  9878.  
  9879.  
  9880.  
  9881.        WinParmGet
  9882.        Returns system information.
  9883.  
  9884.  
  9885.        Syntax:
  9886.         WinParmGet (request#)
  9887.  
  9888.        Parameters:
  9889.         (i) request# see below.
  9890.  
  9891.        Returns:
  9892.         (s)          see below.
  9893.  
  9894.        Note: This function requires Windows 3.1 or higher.
  9895.  
  9896.        The request# parameter determines what piece of information will be
  9897.        returned.
  9898.  
  9899.           Req#   Meaning  Return value
  9900.  
  9901.  
  9902.  
  9903.  
  9904.  
  9905.           1 Beeping       0 = Off, 1 = On
  9906.           2 Mouse sensitivity   "threshold1 threshold2 speed"
  9907.           3 Border Width  Width in pixels
  9908.           4 Keyboard Speed Keyboard Repeat rate
  9909.           5 LangDriver    name of LANGUAGE.DLL
  9910.           6 Horiz. Icon Spacing Spacing in pixels
  9911.           7 Screen Save Timeout Timeout in seconds
  9912.           8 Is screen saver enabled  0 = No, 1 = Yes
  9913.           9 Desktop Grid size   Grid Size
  9914.           10Wallpaper BMP file  BMP file name
  9915.           11Desktop Pattern     Pattern codes (string of 8 space-delimited
  9916.           nums.)
  9917.           12Keyboard Delay Delay in milliseconds
  9918.           13Vertical Icon Spacing    Spacing in pixels
  9919.           14IconTitleWrap 0 = No, 1 = Yes
  9920.           15MenuDropAlign 0 = Right, 1 = Left
  9921.           16DoubleClickWidth    Allowable horiz. movement in pixels for
  9922.           DblClick
  9923.           17DoubleClickHeight   Allowable vert. movement in pixels for
  9924.           DblClick
  9925.           18DoubleClickSpeed    Max time in millisecs between clicks for
  9926.           DblClick
  9927.           19MouseButtonSwap     0 = Not swapped, 1 = swapped
  9928.           20Fast Task Switch    0 = Off, 1 = On
  9929.  
  9930.  
  9931.        Example:
  9932.         If WinParmGet(8) == 1 Then Message("", "Screen saver is active")
  9933.  
  9934.  
  9935.        See Also:
  9936.           Environment, MouseInfo, NetGetCaps, WinConfig, WinMetrics,
  9937.           WinParmSet, WinResources
  9938.  
  9939.  
  9940.  
  9941.  
  9942.        WinParmSet
  9943.        Sets system information.
  9944.  
  9945.  
  9946.        Syntax:
  9947.         WinParmSet (request#, new-value, ini-control)
  9948.  
  9949.        Parameters:
  9950.         (i) request# see WinParmGet
  9951.         (s) new-value see WinParmGet
  9952.         (i) ini-control    see below.
  9953.  
  9954.        Returns:
  9955.         (int)        previous value of the setting.
  9956.  
  9957.        Note: This function requires Windows 3.1 or higher.
  9958.  
  9959.        See WinParmSet for a list of valid request#'s and values.
  9960.  
  9961.  
  9962.  
  9963.  
  9964.  
  9965.        The "ini-control" parameter determines to what extent the value gets
  9966.        updated:
  9967.  
  9968.           0 Set system value in memory only for future reference
  9969.           1 Write new value to appropriate INI file
  9970.           2 Broadcast message to all applications informing them of new value
  9971.           3 Both 1 and 2
  9972.  
  9973.  
  9974.        Example:
  9975.         WinParmSet(9, "2", 3)   ; sets desktop grid size to 2
  9976.  
  9977.  
  9978.        See Also:
  9979.           WallPaper, WinParmGet
  9980.  
  9981.  
  9982.  
  9983.  
  9984.        WinPlace
  9985.        Places a window anywhere on the screen.
  9986.  
  9987.  
  9988.        Syntax:
  9989.         WinPlace (x-ulc, y-ulc, x-brc, y-brc, partial-winname)
  9990.  
  9991.        Parameters:
  9992.         (i) x-ulc    how far from the left of the screen to place the upper-
  9993.                      left corner (0-1000).
  9994.         (i) y-ulc    how far from the top of the screen to place the upper-
  9995.                      left corner (0-1000).
  9996.         (i) x-brc    how far from the left of the screen to place the bottom-
  9997.                      right corner (10-1000) or @NORESIZE.
  9998.         (i) y-brc    how far from the top of the screen to place the bottom-
  9999.                      right corner (10-1000) or @NORESIZE or @ABOVEICONS.
  10000.         (s) partial-winname     either an initial portion of, or an entire
  10001.                      window name.  The most-recently used window whose title
  10002.                      matches the name will be moved to the new position.
  10003.  
  10004.        Returns:
  10005.         (i)          @TRUE if a window was found to move;
  10006.                      @FALSE if no windows were found.
  10007.  
  10008.        Use this function to move windows on the screen.  (You cannot,
  10009.        however, move icons or windows that have been maximized to full
  10010.        screen.)
  10011.  
  10012.        The "x-ulc", "y-ulc", "x-brc", and "y-brc" parameters are based on a
  10013.        logical screen that is 1000 points wide by 1000 points high.
  10014.  
  10015.        You can move the window without changing the width and/or height by
  10016.        specifying @NORESIZE for the "x-brc" and/or "y-brc" parameters,
  10017.        respectively.
  10018.  
  10019.        You can fix the bottom of the window to sit just above the line of
  10020.        icons along the bottom of the screen by specifying a "y-brc" of
  10021.        @ABOVEICONS.
  10022.  
  10023.  
  10024.  
  10025.  
  10026.  
  10027.        Some sample parameters:
  10028.  
  10029.           Upper left quarter of the screen:  0, 0, 500, 500
  10030.           Upper right quarter:  500, 0, 1000, 500
  10031.           Center quarter:  250, 250, 750, 750
  10032.           Lower left eighth:  0, 750, 500, 1000
  10033.  
  10034.        A handy utility program is provided, called WININFO.EXE.  This program
  10035.        lets you take an open window that is sized and positioned the way you
  10036.        like it, and automatically create the proper WinPlace statement for
  10037.        you.  It puts the text into the Clipboard, from which you can paste it
  10038.        into your program.
  10039.  
  10040.        You'll need a mouse to use WinInfo.  While WinInfo is the active
  10041.        window, place the mouse over the window you wish to create the
  10042.        WinPlace statement for, and press the spacebar.  The new statement
  10043.        will be placed into the Clipboard.  Then press the Esc key to close
  10044.        WinInfo.
  10045.  
  10046.  
  10047.        Example:
  10048.         WinPlace(0, 0, 200, 200, "Clock")
  10049.  
  10050.  
  10051.        See Also:
  10052.           WinArrange, WinHide, WinIconize, WinPlaceSet, WinPosition, WinShow,
  10053.           WinZoom
  10054.  
  10055.  
  10056.  
  10057.  
  10058.        WinPlaceGet
  10059.        Returns window coordinates.
  10060.  
  10061.  
  10062.        Syntax:
  10063.         WinPlaceGet (win-type, partial-winname)
  10064.  
  10065.        Parameters:
  10066.         (i) win-type @ICON, @NORMAL, or @ZOOMED
  10067.         (s) partial-winname     the initial part of, or an entire, window
  10068.                      name.
  10069.  
  10070.        Returns:
  10071.         (s)          window coordinates (see below).
  10072.  
  10073.        This function returns the coordinates for an iconized, normal, or
  10074.        zoomed window.
  10075.  
  10076.        "Partial-winname" is the initial part of a window name, and may be a
  10077.        complete window name.  It is case-sensitive.  You should specify
  10078.        enough characters so that "partial-winname" matches only one existing
  10079.        window.  If it matches more than one window, the most recently
  10080.        accessed window which it matches will be used.
  10081.  
  10082.        The returned value is a string of either 2 or 4 numbers, as follows:
  10083.  
  10084.  
  10085.  
  10086.  
  10087.  
  10088.           Iconic windows   "x y"     (upper left corner of the icon)
  10089.           Normal windows   "upper-x upper-y lower-x lower-y"
  10090.           Zoomed windows   "x y"     (upper left corner of the window)
  10091.  
  10092.        All coordinates are relative to a virtual 1000x1000 screen.
  10093.  
  10094.  
  10095.        Examples:
  10096.         Run("clock.exe", "")
  10097.         pos = WinPlaceGet(@NORMAL, "Clock")
  10098.         Delay(2)
  10099.         WinPlaceSet(@NORMAL, "Clock", "250 250 750 750")
  10100.         Delay(2)
  10101.         WinPlaceSet(@NORMAL, "Clock", pos)
  10102.  
  10103.  
  10104.        See Also:
  10105.           WinGetActive, WinItemize, WinPlaceSet, WinPosition, WinState
  10106.  
  10107.  
  10108.  
  10109.  
  10110.        WinPlaceSet
  10111.        Sets window coordinates.
  10112.  
  10113.  
  10114.        Syntax:
  10115.         WinPlaceSet (win-type, partial-winname, position-string)
  10116.  
  10117.        Parameters:
  10118.         (i) win-type @ICON, @NORMAL, or @ZOOMED
  10119.         (s) partial-winname     the initial part of, or an entire, window
  10120.                      name.
  10121.         (s) position-string     window coordinates (see below).
  10122.  
  10123.        Returns:
  10124.         (s)          previous coordinates.
  10125.  
  10126.        This function sets the coordinates for an iconized, normal, or zoomed
  10127.        window.  The window does not have to be in the desired state to set
  10128.        the coordinates; for example, you can set the iconized position for a
  10129.        normal window so that when the window is subsequently iconized, it
  10130.        will go to the coordinates that you've set.
  10131.  
  10132.        "Partial-winname" is the initial part of a window name, and may be a
  10133.        complete window name.  It is case-sensitive.  You should specify
  10134.        enough characters so that "partial-winname" matches only one existing
  10135.        window.  If it matches more than one window, the most recently
  10136.        accessed window which it matches will be used.
  10137.  
  10138.        "Position-string" is a string of either 2 or 4 numbers, as follows:
  10139.  
  10140.           Iconic windows   "x y"     (upper left corner of the icon)
  10141.           Normal windows   "upper-x upper-y lower-x lower-y"
  10142.           Zoomed windows   "x y"     (upper left corner of the window)
  10143.  
  10144.        All coordinates are relative to a virtual 1000x1000 screen.
  10145.  
  10146.  
  10147.  
  10148.  
  10149.  
  10150.  
  10151.        Examples:
  10152.         WinPlaceSet(@ICON, "Clock", "10 950")
  10153.  
  10154.         WinPlaceSet(@NORMAL, "Clock", "250 250 750 750")
  10155.  
  10156.         WinPlaceSet(@ZOOMED, "Clock", "-5 -5")
  10157.  
  10158.  
  10159.        See Also:
  10160.           IconArrange, WinActivate, WinArrange, WinPlace, WinPlaceGet,
  10161.           WinState
  10162.  
  10163.  
  10164.  
  10165.  
  10166.        WinPosition
  10167.        Returns Window position.
  10168.  
  10169.  
  10170.        Syntax:
  10171.         WinPosition (partial-winname)
  10172.  
  10173.        Parameters:
  10174.         (s) partial-winname     the initial part of, or an entire, window
  10175.                      name.
  10176.  
  10177.        Returns:
  10178.         (s)          window coordinates, delimited by commas.
  10179.  
  10180.  
  10181.        Returns the current window position information for the selected
  10182.        window.  It returns 4 comma-separated numbers (see WinPlace for
  10183.        details).
  10184.  
  10185.  
  10186.        Example:
  10187.         Run("clock.exe", "")       ; start Clock
  10188.         WinPlace(0,0,300,300, "Clock")    ; place Clock
  10189.         pos = WinPosition("Clock") ; save position
  10190.         delay(2)
  10191.         WinPlace(200,200,300,300, "Clock")     ; move Clock
  10192.         delay(2)
  10193.         WinPlace(%pos%, "Clock")   ; restore Clock
  10194.  
  10195.  
  10196.        See Also:
  10197.           WinGetActive, WinItemize, WinPlace, WinPlaceGet, WinState
  10198.  
  10199.  
  10200.  
  10201.  
  10202.        WinResources
  10203.        Returns information on available memory and resources.
  10204.  
  10205.  
  10206.  
  10207.  
  10208.  
  10209.  
  10210.        Syntax:
  10211.         WinResources (request#)
  10212.  
  10213.        Parameters:
  10214.         (i) request# see below
  10215.  
  10216.        Returns:
  10217.         (i)          see below.
  10218.  
  10219.        The value of request# determined the piece of information returned.
  10220.  
  10221.           Req#   Return value
  10222.  
  10223.           0  Total available memory, in bytes
  10224.           1  Theoretical maximum available memory, in bytes
  10225.           2  Percent of free system resources (lower of GDI and USER)
  10226.           3  Percent of free GDI resources
  10227.           4  Percent of free USER resources
  10228.  
  10229.  
  10230.        Example:
  10231.         mem = WinResources(0)
  10232.         Message("Available memory", "%mem% bytes")
  10233.  
  10234.  
  10235.        See Also:
  10236.           WinConfig, WinMetrics, WinParmGet
  10237.  
  10238.  
  10239.  
  10240.  
  10241.        WinShow
  10242.        Shows a window in its "normal" state.
  10243.  
  10244.  
  10245.        Syntax:
  10246.         WinShow (partial-winname)
  10247.  
  10248.        Parameters:
  10249.         (s) partial-winname     either an initial portion of, or an entire
  10250.                      window name.  The most-recently used window whose title
  10251.                      matches the name will be shown.
  10252.  
  10253.        Returns:
  10254.         (i)          @TRUE if a window was found to show;
  10255.                      @FALSE if no windows were found.
  10256.  
  10257.        Use this function to restore a window to its "normal" size and
  10258.        position.
  10259.  
  10260.        A partial-window name of "" (null string) restores the current WIL
  10261.        interpreter window.
  10262.  
  10263.  
  10264.  
  10265.  
  10266.  
  10267.  
  10268.        Example:
  10269.         RunZoom("notepad.exe", "")
  10270.         ; other processing...
  10271.         WinShow("Notepad")
  10272.  
  10273.  
  10274.        See Also:
  10275.           WinArrange, WinHide, WinIconize, WinZoom
  10276.  
  10277.  
  10278.  
  10279.  
  10280.        WinState
  10281.        Returns the current state of a window.
  10282.  
  10283.  
  10284.        Syntax:
  10285.         WinState (partial-winname)
  10286.  
  10287.        Parameters:
  10288.         (s) partial-winname     the initial part of, or an entire, window
  10289.                      name.
  10290.  
  10291.        Returns:
  10292.         (i)          window state (see below).
  10293.  
  10294.        "Partial-winname" is the initial part of a window name, and may be a
  10295.        complete window name.  It is case-sensitive.  You should specify
  10296.        enough characters so that "partial-winname" matches only one existing
  10297.        window.  If it matches more than one window, the most recently
  10298.        accessed window which it matches will be used.
  10299.  
  10300.        Possible return values are as follows.
  10301.  
  10302.           Value Symbolic name   Meaning
  10303.  
  10304.           -1                Specified window exists, but is hidden
  10305.           0                 Specified window does not exist
  10306.           1     @ICON       Specified window is iconic (minimized)
  10307.           2     @NORMAL     Specified window is a normal window
  10308.           3     @ZOOMED     Specified window is zoomed (maximized)
  10309.  
  10310.  
  10311.        Example:
  10312.         If WinState("Notepad") == @ICON Then WinShow("Notepad")
  10313.  
  10314.  
  10315.        See Also:
  10316.           Run, WinExist, WinGetActive, WinHide, WinIconize, WinItemize,
  10317.           WinPlace, WinPlaceGet, WinPlaceSet, WinPosition, WinShow, WinZoom
  10318.  
  10319.  
  10320.  
  10321.  
  10322.        WinTitle
  10323.        Changes the title of a window.
  10324.  
  10325.  
  10326.  
  10327.  
  10328.  
  10329.  
  10330.        Syntax:
  10331.         WinTitle (partial-winname, new-name)
  10332.  
  10333.        Parameters:
  10334.         (s) partial-winname     either an initial portion of, or an entire
  10335.                      window name.  The most-recently used window whose title
  10336.                      matches the name will be shown.
  10337.         (s) new-name the new name of the window.
  10338.  
  10339.        Returns:
  10340.         (i)          @TRUE if a window was found to rename;
  10341.                      @FALSE if no windows were found.
  10342.  
  10343.        Use this function to change a window's title.
  10344.  
  10345.        A partial-window name of "" (null string) refers to the current WIL
  10346.        interpreter window.
  10347.  
  10348.        Warning:  Some applications may rely upon their window's title staying
  10349.        the same!  Therefore, the WinTitle function should be used with
  10350.        caution and adequate testing.
  10351.  
  10352.  
  10353.        Example:
  10354.         ; Capitalize title of window
  10355.         htab = Num2Char(9)
  10356.         allwinds = WinItemize()
  10357.         mywin = ItemSelect("Uppercase Windows", allwinds, htab)
  10358.         WinTitle(mywin, StrUpper(mywin))
  10359.         Drop(htab, allwinds, mywin)
  10360.  
  10361.  
  10362.        See Also:
  10363.           WinGetActive, WinItemize, WinName
  10364.  
  10365.  
  10366.  
  10367.  
  10368.        WinVersion
  10369.        Provides the version number of the current Windows system.
  10370.  
  10371.  
  10372.        Syntax:
  10373.         WinVersion (level)
  10374.  
  10375.        Parameters:
  10376.         (i) level    either @MAJOR or @MINOR.
  10377.  
  10378.        Returns:
  10379.         (i)          either major or minor part of the Windows version
  10380.                      number.
  10381.  
  10382.        Use this command to determine which version of Windows is currently
  10383.        running.
  10384.  
  10385.  
  10386.  
  10387.  
  10388.  
  10389.        @MAJOR returns the integer part of the Windows version number; i.e.
  10390.        1.0, 2.11, 3.0, etc.
  10391.  
  10392.        @MINOR returns the decimal part of the Windows version number; i.e.
  10393.        1.0, 2.11, 3.0, etc.
  10394.  
  10395.  
  10396.        Example:
  10397.         minorver = WinVersion(@MINOR)
  10398.         majorver = WinVersion(@MAJOR)
  10399.         Message("Windows Version", StrCat(majorver, ".", minorver))
  10400.  
  10401.  
  10402.        See Also:
  10403.           Version, DOSVersion
  10404.  
  10405.  
  10406.  
  10407.  
  10408.        WinWaitClose
  10409.        Suspends the WIL program execution until a specified window has been
  10410.        closed.
  10411.  
  10412.  
  10413.        Syntax:
  10414.         WinWaitClose (partial-winname)
  10415.  
  10416.        Parameters:
  10417.         (s) partial-winname     either an initial portion of, or an entire
  10418.                      window name.  WinWaitClose suspends execution until all
  10419.                      matching windows have been closed.
  10420.  
  10421.        Returns:
  10422.         (i)          @TRUE if at least one window was found to wait for;
  10423.                      @FALSE if no windows were found.
  10424.  
  10425.        Use this function to suspend the WIL program's execution until the
  10426.        user has finished using a given window and has manually closed it.
  10427.  
  10428.  
  10429.        Example:
  10430.         Run("clock.exe", "")
  10431.         Display(4, "Note", "Close Clock to continue")
  10432.         WinWaitClose("Clock")
  10433.         Message("Continuing...", "Clock closed")
  10434.  
  10435.  
  10436.        See Also:
  10437.           Delay, RunWait, WinExist, Yield
  10438.  
  10439.  
  10440.  
  10441.  
  10442.        WinZoom
  10443.        Maximizes a window to full-screen.
  10444.  
  10445.  
  10446.  
  10447.  
  10448.  
  10449.  
  10450.        Syntax:
  10451.         WinZoom (partial-winname)
  10452.  
  10453.        Parameters:
  10454.         (s) partial-winname     either an initial portion of, or an entire
  10455.                      window name.  The most-recently used window whose title
  10456.                      matches the name will be shown.
  10457.  
  10458.        Returns:
  10459.         (i)          @TRUE if a window was found to zoom;
  10460.                      @FALSE if no windows were found.
  10461.  
  10462.        Use this function to "zoom" windows to full screen size.
  10463.  
  10464.        A partial-window name of "" (null string) zooms the current WIL
  10465.        interpreter window.
  10466.  
  10467.  
  10468.        Example:
  10469.         Run("notepad.exe", "")
  10470.         WinZoom("Notepad")
  10471.         Delay(3)
  10472.         WinShow("Notepad")
  10473.  
  10474.  
  10475.        See Also:
  10476.           RunZoom, WinHide, WinIconize, WinPlace, WinShow
  10477.  
  10478.  
  10479.  
  10480.  
  10481.        Yield
  10482.        Provides time for other windows to do processing.
  10483.  
  10484.  
  10485.        Syntax:
  10486.         Yield
  10487.  
  10488.        Parameters:
  10489.         (none)
  10490.  
  10491.        Returns:
  10492.         (not applicable)
  10493.  
  10494.        Use this command to give other running windows time to process.  This
  10495.        command will allow each open window to process 20 or more messages.
  10496.  
  10497.  
  10498.        Example:
  10499.         ; run Excel and give it some time to start up
  10500.         sheet = AskLine ("Excel", "File to run:", "")
  10501.         Run("excel.exe", sheet)
  10502.         Yield
  10503.         Yield
  10504.         Yield
  10505.  
  10506.  
  10507.  
  10508.  
  10509.  
  10510.  
  10511.        See Also:
  10512.           Delay, Exclusive
  10513.  
  10514.  
  10515.  
  10516.  
  10517.  
  10518.  
  10519.                                     DIALOG BOXES
  10520.  
  10521.        For each dialog box, you must first create a template file, with a
  10522.        (recommended) WDG extension, which will identify the structure of the
  10523.        dialog box, as well as the variables used by it.  Unlike the other WIL
  10524.        functions, you do not actually pass variables to DialogBox as
  10525.        parameters.  However, the DialogBox function does indeed have the
  10526.        ability to manipulate, and even create, variables.  If you are
  10527.        familiar with programming, you may think of DialogBox as a subroutine,
  10528.        and all the variables it uses as being global.
  10529.  
  10530.        Let's start with a simple example.  Suppose we want to write a WIL
  10531.        program which starts up Notepad, with two options which can be
  10532.        selected at runtime:
  10533.  
  10534.        Here's what the template file will look like:
  10535.  
  10536.         [zoom+1Start editor zoomed]
  10537.         [backup+1Save backup of file]
  10538.  
  10539.        It is an ordinary ASCII file.
  10540.  
  10541.        Some explanation is in order.  First, note the square brackets.  Each
  10542.        element in a WDG file is enclosed in brackets; in this case, there are
  10543.        two distinct elements.  Next, notice that the first items that appear
  10544.        inside the brackets are variable names -- in this case, zoom and
  10545.        backup.  Immediately following the variable name is a plus sign (+),
  10546.        which identifies the elements as being check boxes.  After the +
  10547.        symbol is the number 1, which represents the value that will be
  10548.        assigned to the variable if the box gets checked.  Note that there is
  10549.        no space before or after the + symbol.  Finally, we have the text
  10550.        which will be displayed next to the check box.
  10551.  
  10552.        Now, let's create the WIL program file which will use this WDG
  10553.        template:
  10554.  
  10555.         file = ItemSelect("", FileItemize("*.*"), " ")
  10556.         DialogBox("Edit a file", "edit.wdg")
  10557.         If backup == 0 Then Goto nobackup
  10558.         filebackupname = StrCat(FileRoot(file), ".", "bak")
  10559.         FileCopy(file, filebackupname, @TRUE)
  10560.         :nobackup
  10561.         If zoom == 1 Then Run("notepad.exe", file)
  10562.         If zoom == 1 Then RunZoom("notepad.exe", file)
  10563.  
  10564.        The WDG template file should be in the current directory or in a
  10565.        directory on your path; otherwise, you must give a complete path
  10566.        specification for it when it appears in the DialogBox statement.
  10567.  
  10568.        Now, run the WIL program.  See how the lines in the template file got
  10569.        translated to fields in the dialog box.  Also notice the two buttons
  10570.        that were added at the bottom -- OK and Cancel.  Cancel terminates the
  10571.        WIL program entirely.
  10572.  
  10573.        You may want to try running this with various combinations of boxes
  10574.        checked, just to confirm that it works properly.  It should.
  10575.  
  10576.  
  10577.  
  10578.  
  10579.  
  10580.        Now, look again at the WIL program.  Notice how the variables zoom and
  10581.        backup do not appear until after the DialogBox statement.  In essence,
  10582.        these variables are created by the WDG template, and initialized with
  10583.        values of 0.  If the user checks a box, the variable associated with
  10584.        that box is given the value which appears next to the + symbol in the
  10585.        template.  So, if the first box is checked, then zoom will have a
  10586.        value of 1 after the DialogBox statement is executed.  If it remains
  10587.        un-checked, it will still have a value of 0.  These values can then be
  10588.        used in your WIL program, as we have done above.
  10589.  
  10590.        Suppose that you want a box to be checked, by default.  All you need
  10591.        to do is to assign a non-zero value to the corresponding variable
  10592.        before you execute the DialogBox statement.  For example:
  10593.  
  10594.         file = ItemSelect("", FileItemize("*.*"), " ")
  10595.         zoom = 1
  10596.         DialogBox("Edit a file", "edit.wdg")
  10597.         If backup == 0 Then Goto nobackup
  10598.         filebackupname = StrCat(FileRoot(file), ".", "bak")
  10599.         FileCopy(file, filebackupname, @TRUE)
  10600.         :nobackup
  10601.         If zoom == 0 Then Run("notepad.exe", file)
  10602.         If zoom == 1 Then RunZoom("notepad.exe", file)
  10603.  
  10604.        When you run it this time, the first box will already be checked,
  10605.        because we first assigned a value of 1 to the variable zoom.  The
  10606.        variable will still have a value of 1 after the DialogBox statement is
  10607.        executed -- unless the user un-checks the box, in which case it will
  10608.        have a value of 0.  The variable associated with an unchecked box is
  10609.        always equal to 0; the variable associated with a checked box is equal
  10610.        to the value you specify for that box.  For the most part, you would
  10611.        be fine simply using a value of 1 to indicate a checked box.
  10612.  
  10613.        You can change the layout of the WDG template to suit your taste.  For
  10614.        example, this:
  10615.  
  10616.         [zoom+1Start editor zoomed]   [backup+1Save backup of file]
  10617.  
  10618.        would put the two check boxes side by side.  However, you may not put
  10619.        tab characters in a template file, so be sure to use spaces instead
  10620.        (unless your editor can convert tabs to spaces).  Also, template files
  10621.        are limited to 20 lines, and to the first 60 columns
  10622.  
  10623.        The next element which you can use in a dialog box is the radio
  10624.        button.  Whereas you can have several check boxes checked at one time,
  10625.        the radio button gets its name from the five-button car radio, which
  10626.        can only have one station selected at a time.  You can have more than
  10627.        one group of radio buttons, but only one button in each group may be
  10628.        "pressed."  Therefore, this is ideal for situations where the user
  10629.        must make a choice from multiple alternatives:
  10630.  
  10631.        Here's a group of four radio buttons:
  10632.  
  10633.         [editor^1Notepad]       [editor^2WinEdit]
  10634.         [editor^3Write]         [editor^4WinWord]
  10635.  
  10636.  
  10637.  
  10638.  
  10639.  
  10640.        Let's look at how these are different from check boxes.  First, the
  10641.        symbol which identifies a radio button is a caret (^), instead of a +.
  10642.        Second, each of the buttons has the same variable name (editor).  And
  10643.        third, each button has a unique value following the ^ symbol.
  10644.  
  10645.        This should make sense if you consider what we are trying to
  10646.        accomplish: we want to obtain a value for the variable editor.  The
  10647.        user has four programs to choose from, and he must choose one, and
  10648.        only one.  As you have probably guessed, the value associated with the
  10649.        button which the user "pushes" will be assigned to editor.
  10650.  
  10651.        Let's add this to our existing EDIT.WDG template:
  10652.  
  10653.         [zoom+1Start editor zoomed]
  10654.         [backup+1Save backup of file]
  10655.         [editor^1Notepad]       [editor^2WinEdit]
  10656.         [editor^3Write]         [editor^4WinWord]
  10657.  
  10658.        and expand our WIL program to take advantage of it:
  10659.  
  10660.         file = ItemSelect("", FileItemize("*.*"), " ")
  10661.         zoom = 1
  10662.         DialogBox("Edit a file", "edit.wdg")
  10663.         If backup == 0 Then Goto nobackup
  10664.         filebackupname = StrCat(FileRoot(file), ".", "bak")
  10665.         FileCopy(file, filebackupname, @TRUE)
  10666.         :nobackup
  10667.         If zoom == 0 Then runcmd = "Run"
  10668.         If zoom == 1 Then runcmd = "RunZoom"
  10669.         If editor == 1 Then %runcmd%("notepad.exe", file)
  10670.         If editor == 2 Then %runcmd%("winedit.exe", file)
  10671.         If editor == 3 Then %runcmd%("write.exe", file)
  10672.         If editor == 4 Then %runcmd%("winword.exe", file)
  10673.  
  10674.        (We're using the variable runcmd to avoid having to code eight
  10675.        separate Run and RunZoom statements.  Pretty clever, isn't it.)
  10676.  
  10677.        Look at how we are testing the value of editor to determine which
  10678.        program to run.  When the DialogBox statement is executed, the first
  10679.        radio button in each group is selected, regardless of its value.  In
  10680.        this case, the first button appearing in the template, in the editor
  10681.        group, has a value of 1, so, unless the user selects a different
  10682.        button, the variable editor will have a value of 1 after DialogBox
  10683.        finishes, and Notepad will be run.  If the user selects the WinEdit
  10684.        button, editor will have a value of 2 , and Winedit will be run.
  10685.  
  10686.        Another important element which you can use in your templates is the
  10687.        file selection list box, which combines the functionality of
  10688.        DirItemize, FileItemize, and ItemSelect.  It has the following form:
  10689.  
  10690.         [file\                       ]
  10691.         [file\                       ]
  10692.         [file\                       ]
  10693.         [file\                       ]
  10694.         [file\                       ]
  10695.  
  10696.  
  10697.  
  10698.  
  10699.  
  10700.        Here, file is the variable name (you can use another name instead of
  10701.        file), and the backslash (\) is the symbol which identifies this as a
  10702.        file list element.  The amount of space between the \ symbol and the
  10703.        right bracket will determine the width of the file selection list box.
  10704.        And the number of occurrences of this element (each must have an
  10705.        identical name) will determine the height of the list box.
  10706.  
  10707.        Let's add this to our template:
  10708.  
  10709.         [zoom+1Start editor zoomed]
  10710.         [backup+1Save backup of file]
  10711.         [editor^1Notepad]       [editor^2WinEdit]
  10712.         [editor^3Write]         [editor^4WinWord]
  10713.         [file\                       ]
  10714.         [file\                       ]
  10715.         [file\                       ]
  10716.         [file\                       ]
  10717.         [file\                       ]
  10718.  
  10719.        and revise our program:
  10720.  
  10721.         zoom = 1
  10722.         DialogBox("Edit a file", "edit.wdg")
  10723.         If backup == 0 Then Goto nobackup
  10724.         filebackupname = StrCat(FileRoot(file), ".", "bak")
  10725.         FileCopy(file, filebackupname, @TRUE)
  10726.         :nobackup
  10727.         If zoom == 0 Then runcmd = "Run"
  10728.         If zoom == 1 Then runcmd = "RunZoom"
  10729.         If editor == 1 Then %runcmd%("notepad.exe", file)
  10730.         If editor == 2 Then %runcmd%("winedit.exe", file)
  10731.         If editor == 3 Then %runcmd%("write.exe", file)
  10732.         If editor == 4 Then %runcmd%("winword.exe", file)
  10733.  
  10734.        All we did was remove the first line from the earlier example, which
  10735.        used FileItemize and ItemSelect to retrieve a file name.
  10736.  
  10737.        By default, the file selection list box uses *.* as a file mask.  If
  10738.        you want to limit the selection to, say, DOC files, assign a value to
  10739.        the appropriate variable before executing the DialogBox statement:
  10740.  
  10741.         file = "*.doc"
  10742.         DialogBox("Edit a file", "edit.wdg")
  10743.  
  10744.        Another element, the file mask edit box, allows the user to change the
  10745.        file mask interactively.  It's format is:
  10746.  
  10747.         [file#        ]
  10748.  
  10749.        Where the variable name, in this case file, must be the same as the
  10750.        one used in the file selection list box, and is followed by a number
  10751.        sign (#).  If the user enters a valid wild card mask in the file mask
  10752.        edit box, the file display in the file selection list box will be
  10753.        updated accordingly.  For example, if DOC files are currently shown,
  10754.        and the user types *.TXT, the display will change to show TXT files.
  10755.  
  10756.  
  10757.  
  10758.  
  10759.  
  10760.        You can optionally display the current directory (whose contents are
  10761.        being listed) by including an additional element in the template:
  10762.  
  10763.         [file$                       ]
  10764.  
  10765.        This is identical to the file list element, except the symbol for the
  10766.        directory element is a dollar sign ($).  The variable name must be the
  10767.        same as the one used in the file selection list box:
  10768.  
  10769.         [file$                       ]
  10770.             File mask [file#         ]
  10771.         [file\                       ]
  10772.         [file\                       ]
  10773.         [file\                       ]
  10774.         [file\                       ]
  10775.         [file\                       ]
  10776.  
  10777.        Note that we have included the descriptive text "File mask" next to
  10778.        the file mask edit box.  You may place explanatory text anywhere in
  10779.        the template file, as long as it doesn't appear inside square
  10780.        brackets.
  10781.  
  10782.        You can also display a WIL variable in your dialog box by using an
  10783.        element of this form:
  10784.  
  10785.         [varname$]
  10786.  
  10787.        Where the name of the variable is followed by a dollar sign ($).  The
  10788.        WIL Interpreter will replace this with the current value of the
  10789.        variable.
  10790.  
  10791.        Finally, we have the edit box, which allows us to assign user-supplied
  10792.        text to a variable.  The edit box element has the form:
  10793.  
  10794.         [input#                      ]
  10795.  
  10796.        The variable name (in this case, input) is followed a number sign (#),
  10797.        and the width of the area between the brackets determines the width of
  10798.        the edit box which gets displayed.  Whatever the user types in the box
  10799.        gets assigned to the associated variable.  Here is a sample RENAME.WDG
  10800.        template:
  10801.  
  10802.         Select file to be renamed
  10803.         [oldname$                         ]
  10804.         [oldname\                         ]
  10805.         [oldname\                         ]
  10806.         [oldname\                         ]
  10807.         [oldname\                         ]
  10808.  
  10809.         Type new name for the file
  10810.         [newname#                         ]
  10811.  
  10812.        Which could be used with this program:
  10813.  
  10814.         DialogBox("File Rename", "rename.wdg")
  10815.         FileRename(oldname, newname)
  10816.  
  10817.  
  10818.  
  10819.  
  10820.  
  10821.        You will have noticed that there are two symbols -- $ and # -- which
  10822.        have dual meanings, depending on whether or not there is a file list
  10823.        selection variable in the template with the same name.  The three file
  10824.        elements -- [file\], [file$], and [file#] -- are a "set", and share a
  10825.        common variable name.  All other variables in your template should
  10826.        have unique names.
  10827.  
  10828.  
  10829.  
  10830.  
  10831.  
  10832.  
  10833.                                      APPENDIX A
  10834.  
  10835.                                 Predefined Constants
  10836.  
  10837.        WIL provides you with a number of predefined integer constants to help
  10838.        make your WIL programs more mnemonic:
  10839.  
  10840.  
  10841.        Logical Conditions                    String Handling
  10842.        @FALSE                                @FWDSCAN
  10843.        @NO                                   @BACKSCAN
  10844.        @OFF
  10845.        @TRUE                                 Menu Handling
  10846.        @YES                                  @ENABLE
  10847.        @ON                                   @DISABLE
  10848.                                              @UNCHECK
  10849.        Window Arranging                      @CHECK
  10850.        @NORESIZE
  10851.        @ABOVEICONS                           System Control
  10852.        @STACK                                @MAJOR
  10853.        @ARRANGE                              @MINOR
  10854.        @TITLE
  10855.        @ROWS                                 Error Handling
  10856.        @COLUMNS                              @CANCEL
  10857.                                              @NOTIFY
  10858.                                              @OFF
  10859.  
  10860.                                              Keyboard Status
  10861.                                              @SHIFT
  10862.                                              @CTRL
  10863.  
  10864.                                              Debug Control
  10865.                                              @PARSEONLY
  10866.  
  10867.  
  10868.  
  10869.  
  10870.  
  10871.  
  10872.  
  10873.                                      APPENDIX B
  10874.  
  10875.                                        Errors
  10876.  
  10877.        If the current error mode is @CANCEL (the default), any WIL errors
  10878.        encountered while processing a WIL program cause the item to be
  10879.        canceled with an error message.
  10880.  
  10881.  
  10882.  
  10883.  
  10884.        Minor Errors
  10885.        Minor errors are ignored if the current error mode has been set to
  10886.        @OFF.  If the error mode is @NOTIFY the user has the option of
  10887.        continuing with the WIL program or canceling it.
  10888.  
  10889.        1006 File Copy/Move: No matching files found
  10890.        1017 File Delete: No matching files found
  10891.        1018 File Delete: Delete Failed
  10892.        1024 File Rename: No matching files found
  10893.        1025 File Rename: Rename failed
  10894.        1028 LogDisk: Requested drive not online
  10895.        1029 DirMake: Dir not created
  10896.        1030 DirRemove: Dir not removed
  10897.        1031 DirChange: Dir not found/changed
  10898.        1039 WinClose: Window not found
  10899.        1040 WinHide: Window not found
  10900.        1041 WinIconize: Window not found
  10901.        1042 WinZoom: Window not found
  10902.        1043 WinShow: Window not found
  10903.        1044 WinPlace: Window not found
  10904.        1045 WinActivate: Window not found
  10905.        1077 FileOpen: Open failed
  10906.        1119 WinPosition: Window not found
  10907.        1121 WinTitle: Window not found
  10908.        1100 StrIndex/StrScan 3rd parameter out of bounds
  10909.  
  10910.  
  10911.  
  10912.  
  10913.  
  10914.        1900 WinExec 0: Out of Memory
  10915.        1902 WinExec 2: File Not Found
  10916.        1903 WinExec 3: Path Not Found
  10917.        1905 WinExec 5: Attempt to dynlink to a task
  10918.        1906 WinExec 6: Lib requires data segs for each task
  10919.        1910 WinExec 10: Incorrect Windows Version
  10920.        1911 WinExec 11: Invalid EXE file
  10921.        1912 WinExec 12: Cannot run OS/2 application
  10922.        1913 WinExec 12: Cannot run DOS4.0 application
  10923.        1914 WinExec 14: Unknown EXE type
  10924.        1915 WinExec 15: Attempt to run old EXE in protect mode
  10925.        1916 WinExec 16: Attempted 2nd EXE with multiple writeable datasegs
  10926.        1917 WinExec 17: Nonshareable DLLs already in use
  10927.        1918 WinExec 18: App marked for protected mode only
  10928.        1932 WinExec: Undefined Error
  10929.  
  10930.  
  10931.  
  10932.        Moderate Errors
  10933.        If the error mode is @NOTIFY or @OFF, the user has the option of
  10934.        continuing with the WIL program or canceling it.
  10935.  
  10936.        2001 SendKey: Illegal Parameters
  10937.        2002 File Copy/Move: 'From' file illegal
  10938.        2003 File Copy/Move: 'To'   file illegal
  10939.        2004 File Copy/Move: Cannot copy/move wildcards into fixed root
  10940.        2005 File Copy/Move: Cannot copy/move wildcards into fixed extension
  10941.        2007 File Move: Unable to rename source file
  10942.        2015 File Move:  Unable to remove source file
  10943.        2016 File Delete: File name illegal
  10944.        2019 File Rename: 'From' file illegal
  10945.        2020 File Rename: 'To' file illegal
  10946.        2021 File Rename: Attempt to rename across drive boundary. - Use MOVE
  10947.             instead.
  10948.        2022 File Rename: Cannot rename wildcards into a fixed filename root
  10949.        2023 File Rename: Cannot rename wildcards into a fixed filename
  10950.             extension
  10951.        2038 WinCloseNot Function Syntax error
  10952.        2045 WinActivate: Window not found
  10953.        2058 StrCat function syntax error
  10954.        2060 Average function syntax error
  10955.        2093 Dialog Box: Bad Filespec, using *.*
  10956.        2112 FileSize: File Not Found
  10957.        2118 FileCopy/Move: Destination file same as source
  10958.  
  10959.  
  10960.  
  10961.        Fatal Errors
  10962.        Fatal errors cause the current WIL program to be canceled with an
  10963.        error message, regardless of the error mode in effect.  (We show the
  10964.        error codes here for consistency, but in practice you will never be
  10965.        able to call LastError after a fatal error.)
  10966.  
  10967.        3008 File Copy/Move: 'From' file open error
  10968.        3009 SendKey: Could not open DEBUG text file
  10969.        3010 SendKey: Could not install hook - Already Active??
  10970.        3011 File Copy/Move: 'From' file length error
  10971.  
  10972.  
  10973.  
  10974.  
  10975.  
  10976.        3012 File Copy/Move: No room left on disk.  Out of space??
  10977.        3013 File Copy/Move: 'To' file open error
  10978.        3014 File Copy/Move: I/O Error
  10979.        3015 File Move:  Unable to remove source file
  10980.        3026 LogDisk: Illegal disk drive
  10981.        3027 LogDisk: DOS reports no disks!!  ???
  10982.        3032 GoTo unable to lock memory for batch file
  10983.        3033 GoTo label not found
  10984.        3034 Clipboard owned by another app.  Cannot open.
  10985.        3035 Clipboard does not contain text for ClipAppend.
  10986.        3036 Clipboard cannot hold that much text (>64000 bytes)
  10987.        3037 Unable to allocate memory for clipboard.  Close some applications
  10988.        3046 Internal Error 3046. Function not defined
  10989.        3047 Variable name over 30 chars. Too Long
  10990.        3048 Substitution %Variable% not followed by % (Use %% for %)
  10991.        3049 No variables exist??!!
  10992.        3050 Undefined variable
  10993.        3051 Undefined variable or function
  10994.        3052 Uninitialized variable or undefined function
  10995.        3053 Character string too long (>256 chars??)
  10996.        3054 Unrecognizable item found on line
  10997.        3055 Variable name is over 30 chars. Too Long
  10998.        3056 Variable could not be converted to string
  10999.        3057 Variable could not be converted to integer
  11000.        3059 Illegal Bounds for StrSub function
  11001.        3061 Illegal Syntax
  11002.        3062 Attempt to divide by zero
  11003.        3063 Internal Error 3063. Binary op not found
  11004.        3064 Internal Error 3064. Unary op not found
  11005.        3065 Unbalanced Parenthesis
  11006.        3066 Wrong Number of Arguments in Function
  11007.        3067 Function Syntax. Opening parenthesis missing.
  11008.        3068 Function Syntax. Illegal delimiter found.
  11009.        3069 Illegal assignment statement. (Use == for equality testing)
  11010.        3070 Internal error 3070.  Too many arguments defined.
  11011.        3071 Missing or incomplete statement
  11012.        3072 THEN not found in IF statement
  11013.        3073 Goto Label not specified
  11014.        3074 Expression continues past expected end.
  11015.        3075 Call: Parse of file/parameter line failed
  11016.        3076 FileOpen: READ or WRITE not properly specified
  11017.        3078 FileOpen: Too many (>5) files open
  11018.        3079 FileClose: Invalid file handle
  11019.        3080 FileClose: File not currently open
  11020.        3081 FileRead: Invalid file handle
  11021.        3082 FileRead: File not currently open
  11022.        3084 FileWrite: Invalid file handle
  11023.        3085 FileWrite: File not currently open
  11024.        3087 FileRead:  File not open for reading
  11025.        3088 FileRead: Attempt to read past end of file
  11026.        3089 FileWrite: File not open for writing
  11027.        3090 Dialog Box: File open error
  11028.        3091 Dialog Box: Box too large
  11029.        3092 Dialog Box: Non-text control used w/filebox.
  11030.        3094 Dialog Box: Window Registration Failed
  11031.        3095 Compare could not be resolved into a integer or string compare
  11032.        3096 Memory allocation failure.  Out of memory for string storage
  11033.  
  11034.  
  11035.  
  11036.  
  11037.  
  11038.        3097 Memory allocation failure.  Out of memory for variable storage
  11039.        3098 Internal error, NULL pointer passed to xstrxxx subroutines
  11040.        3099 CallExt function disabled.  Not currently available.
  11041.        3101 Substituted line too long. (> 256 characters)
  11042.        3102 Drop: Can only drop variables
  11043.        3103 IsDefined: Attempting to test non-variables item
  11044.        3104 Dialog Box: Window Creation Failed
  11045.        3105 Batch Compiler:  CALL and CALLEXT not supported in compiled EXE
  11046.             versions
  11047.        3107 Run: Filetype is not COM, EXE, PIF or BAT
  11048.        3108 FileItemize: Unable to lock file info segment
  11049.        3109 FileItemize: Unable to unlock file info segment
  11050.        3110 FileItemize: Unable to lock file index segment
  11051.        3111 FileItemize: Unable to unlock file index segment
  11052.        3113 FileSize: Filelength I/O Error
  11053.        3114 FileSize: Buffer Overrun Error
  11054.        3115 FileDelete: Buffer Overrun Error
  11055.        3116 FileRename: Buffer Overrun Error
  11056.        3117 FileCopyMove: Buffer Overrun Error
  11057.  
  11058.  
  11059.  
  11060.  
  11061.  
  11062.  
  11063.                                      APPENDIX A
  11064.  
  11065.                                        Browser
  11066.  
  11067.        The Command Post Browser program lets you view a file's contents in a
  11068.        variety of ways.
  11069.  
  11070.        The default is to show the file in Windows' "ANSI text" mode:
  11071.  
  11072.  
  11073.  
  11074.  
  11075.  
  11076.  
  11077.        Initial Browser View - ANSI Text
  11078.  
  11079.        As you can see, Browser gives you five main menus to choose from:
  11080.  
  11081.  
  11082.        File
  11083.        These menu items let you open a new file to view, re-read the current
  11084.        file, and perform other housekeeping functions including exiting the
  11085.        program.
  11086.  
  11087.  
  11088.        Hide & Seek
  11089.        Browser gives you the ability to filter which lines you view with its
  11090.        Hide & Seek commands.  You can hide or show specific lines by entering
  11091.        a word to look for.
  11092.  
  11093.        For instance, the menu item Hide & Seek/Show if... displays this
  11094.        dialog box:
  11095.  
  11096.  
  11097.  
  11098.  
  11099.  
  11100.  
  11101.        ...and (in this example) shows only the lines containing the word
  11102.        "modem":
  11103.  
  11104.  
  11105.  
  11106.  
  11107.  
  11108.  
  11109.  
  11110.        Print
  11111.        These selections allow you to print all or part of the file.
  11112.  
  11113.  
  11114.        Clip Copy
  11115.        Lets you copy portions of the file into the Windows Clipboard.
  11116.  
  11117.  
  11118.        Clip Append
  11119.        Lets you add portions of the file onto the end of the Windows
  11120.        Clipboard.
  11121.  
  11122.  
  11123.        Options
  11124.        These menu items let you change how you view the file; changing for
  11125.        example between ASCII text mode (which interprets some special
  11126.        characters differently than ANSI text) and hex-dump formats:
  11127.  
  11128.  
  11129.  
  11130.  
  11131.  
  11132.  
  11133.                  Options/ASCII text                 Options/Hex dump
  11134.  
  11135.